mirror of
https://github.com/php/php-src.git
synced 2024-11-28 12:26:37 +08:00
37 lines
623 B
PHP
37 lines
623 B
PHP
--TEST--
|
|
Try catch finally (multi catch blocks with return)
|
|
--FILE--
|
|
<?php
|
|
|
|
class AE extends Exception {};
|
|
class BE extends Exception {};
|
|
|
|
function foo () {
|
|
try {
|
|
try {
|
|
try {
|
|
throw new Exception("try");
|
|
} catch (AE $e) {
|
|
die("error");
|
|
} finally {
|
|
echo "1";
|
|
}
|
|
} finally {
|
|
echo "2";
|
|
}
|
|
} catch (BE $e) {
|
|
die("error");
|
|
} catch (Exception $e) {
|
|
echo "3";
|
|
} finally {
|
|
echo "4";
|
|
return 4;
|
|
}
|
|
return 5;
|
|
}
|
|
|
|
var_dump(foo());
|
|
?>
|
|
--EXPECTF--
|
|
1234int(4)
|