1
0
mirror of https://github.com/php/php-src.git synced 2026-04-17 13:01:02 +02:00
Files
archived-php-src/Zend/tests/exception_011.phpt
twosee d5456baf52 Use zend_throw_unwind_exit() for assert.bail (#6826)
We can use unwind_exit instead of the evil zend_bailout without breaking the original behavior in this way because the original zend_bailout will longjmp out of the executor, so the exception will never be caught and it always triggers the E_ERROR here.
2021-04-13 15:23:36 +08:00

25 lines
504 B
PHP

--TEST--
Test exception doesn't cause RSHUTDOWN bypass, variation 0
--INI--
assert.bail=1
assert.exception=1
--FILE--
<?php
define ("XXXXX", 1);
try {
assert(false);
} catch (AssertionError $error) {
echo "Caught\n";
}
?>
--EXPECTHEADERS--
Content-type: text/html; charset=UTF-8
--EXPECTF--
Fatal error: Uncaught AssertionError: assert(false) in %sexception_011.php:%d
Stack trace:
#0 %sexception_011.php(%d): assert(false, 'assert(false)')
#1 {main}
thrown in %sexception_011.php on line %d