mirror of
https://github.com/php/php-src.git
synced 2024-12-24 01:09:58 +08:00
60a29791e4
Refactor the implemention, make codes clear
33 lines
373 B
PHP
33 lines
373 B
PHP
--TEST--
|
|
Try catch finally (basic test)
|
|
--FILE--
|
|
<?php
|
|
function foo ($throw = FALSE) {
|
|
try {
|
|
echo "try\n";
|
|
if ($throw) {
|
|
throw new Exception("ex");
|
|
}
|
|
} catch (Exception $e) {
|
|
echo "catch\n";
|
|
} finally {
|
|
echo "finally\n";
|
|
}
|
|
|
|
echo "end\n";
|
|
}
|
|
|
|
foo();
|
|
echo "\n";
|
|
foo(true);
|
|
?>
|
|
--EXPECTF--
|
|
try
|
|
finally
|
|
end
|
|
|
|
try
|
|
catch
|
|
finally
|
|
end
|