php-8.0.30-src/Zend/tests/try/catch_finally_001.phpt

33 lines
371 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);
?>
--EXPECT--
try
finally
end
try
catch
finally
end