mirror of
https://github.com/php/php-src.git
synced 2024-12-18 14:30:35 +08:00
60a29791e4
Refactor the implemention, make codes clear
22 lines
327 B
PHP
22 lines
327 B
PHP
--TEST--
|
|
Try catch finally (with multi-returns and exception)
|
|
--FILE--
|
|
<?php
|
|
function foo ($a) {
|
|
try {
|
|
throw new Exception("ex");
|
|
} catch (PdoException $e) {
|
|
die("error");
|
|
} catch (Exception $e) {
|
|
return 2;
|
|
} finally {
|
|
return 3;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
var_dump(foo("para"));
|
|
?>
|
|
--EXPECTF--
|
|
int(3)
|