mirror of
https://github.com/php/php-src.git
synced 2024-10-01 23:06:11 +00:00
80d5ae3cea
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
37 lines
600 B
PHP
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)
|