php-src/Zend/tests/exit_finally_1.phpt
Nikita Popov 75a04eac97 Make exit() unwind properly
exit() is now internally implemented by throwing an exception,
performing a normal stack unwind and a clean shutdown. This ensures
that no persistent resource leaks occur.

The exception is internal, cannot be caught and does not result in
the execution of finally blocks. This may be relaxed in the future.

Closes GH-5768.
2020-06-29 15:50:12 +02:00

20 lines
265 B
PHP

--TEST--
exit() and finally (1)
--FILE--
<?php
// TODO: In the future, we should execute the finally block.
try {
exit("Exit\n");
} catch (Throwable $e) {
echo "Not caught\n";
} finally {
echo "Finally\n";
}
echo "Not executed\n";
?>
--EXPECT--
Exit