php-src/Zend/tests/bug35017.phpt

22 lines
453 B
Plaintext
Raw Normal View History

--TEST--
Bug #35017 (Exception thrown in error handler may cause unexpected behavior)
--FILE--
<?php
set_error_handler('errorHandler');
try {
2020-02-04 05:52:20 +08:00
if ($a) {
echo "1\n";
} else {
echo "0\n";
}
echo "?\n";
2018-09-17 01:16:42 +08:00
} catch(Exception $e) {
2018-08-10 10:19:55 +08:00
echo "This Exception should be caught\n";
}
function errorHandler($errno, $errstr, $errfile, $errline) {
2020-02-04 05:52:20 +08:00
throw new Exception('Some Exception');
}
?>
--EXPECT--
2018-08-10 10:19:55 +08:00
This Exception should be caught