mirror of
https://github.com/php/php-src.git
synced 2024-09-23 19:07:26 +00:00
2f1f34952e
I'm removing the argument entirely here, but we might want to change this to passing null or and empty array instead, if the impact of dropping it entirely turns out to be too large. This was deprecated as part of https://wiki.php.net/rfc/deprecations_php_7_2 as a doc-only deprecation.
33 lines
850 B
PHP
33 lines
850 B
PHP
--TEST--
|
|
Bug #61767 (Shutdown functions not called in certain error situation)
|
|
--FILE--
|
|
<?php
|
|
set_error_handler(function($code, $msg, $file = null, $line = null) {
|
|
echo "Error handler called ($msg)\n";
|
|
throw new \ErrorException($msg, $code, 0, $file, $line);
|
|
});
|
|
|
|
register_shutdown_function(function(){
|
|
echo "Shutting down\n";
|
|
print_r(error_get_last());
|
|
});
|
|
|
|
//$undefined = null; // defined variable does not cause problems
|
|
$undefined->foo();
|
|
--EXPECTF--
|
|
Error handler called (Undefined variable: undefined)
|
|
|
|
Fatal error: Uncaught ErrorException: Undefined variable: undefined in %sbug61767.php:%d
|
|
Stack trace:
|
|
#0 %sbug61767.php(%d): {closure}(%s, 'Undefined varia...', '%s', %d)
|
|
#1 {main}
|
|
thrown in %sbug61767.php on line %d
|
|
Shutting down
|
|
Array
|
|
(
|
|
[type] => 1
|
|
[message] => %a
|
|
[file] => %sbug61767.php
|
|
[line] => %d
|
|
)
|