php-src/Zend/tests/try_finally_001.phpt
Xinchen Hui 60a29791e4 Fixed bug that jmp in try block jmp over finally block
Refactor the implemention,  make codes clear
2012-08-22 18:32:03 +08:00

23 lines
382 B
PHP

--TEST--
Try finally (basic test)
--FILE--
<?php
function foo ($a) {
try {
throw new Exception("ex");
} finally {
var_dump($a);
}
}
foo("finally");
?>
--EXPECTF--
string(7) "finally"
Fatal error: Uncaught exception 'Exception' with message 'ex' %s
Stack trace:
#0 %stry_finally_001.php(%d): foo('finally')
#1 {main}
thrown in %stry_finally_001.php on line %d