php-src/Zend/tests/catch_finally_006.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

29 lines
476 B
PHP

--TEST--
Try catch finally (re-throw exception in catch block)
--FILE--
<?php
function foo ($a) {
try {
throw new Exception("ex");
} catch (Exception $e) {
var_dump($a);
throw $e;
} finally {
var_dump("finally");
return "return";
}
return 1;
}
try {
var_dump(foo("para"));
} catch (Exception $e) {
"caught exception" . PHP_EOL;
var_dump($e->getMessage());
}
?>
--EXPECT--
string(4) "para"
string(7) "finally"
string(2) "ex"