php-src/Zend/tests/try_catch_finally_001.phpt
Xinchen Hui 80d5ae3cea Implemented 'finally' keywords for php
RFC: https://wiki.php.net/rfc/finally
FR: https://bugs.php.net/bug.php?id=32100
and I have got some improvment ideas(performance), will implemented
later. thanks
2012-08-13 21:48:39 +08:00

37 lines
600 B
PHP

--TEST--
Try catch finally
--FILE--
<?php
class AE extends Exception {};
class BE extends Exception {};
function foo () {
try {
try {
try {
throw new Exception("try");
} catch (AE $e) {
echo "0";
die("error");
} finally {
echo "1";
}
} finally {
echo "2";
}
} catch (BE $e) {
die("error");
} catch (Exception $e) {
echo "3";
} finally {
echo "4";
}
return 1;
}
var_dump(foo());
?>
--EXPECTF--
1234int(1)