php-src/Zend/tests/catch_finally_001.phpt
Xinchen Hui 60a29791e4 Fixed bug that jmp in try block jmp over finally block
Refactor the implemention,  make codes clear
2012-08-22 18:32:03 +08:00

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