📄 bug32647.phpt
字号:
--TEST--Bug #32647 (Using register_shutdown_function() with invalid callback can crash PHP)--INI--error_reporting=2047display_errors=1--FILE--<?phpfunction foo(){ echo "joo!\n";}class bar{ function barfoo () { echo "bar!\n"; }}unset($obj);register_shutdown_function(array($obj,"")); // Invalidregister_shutdown_function(array($obj,"some string")); // Invalidregister_shutdown_function(array(0,"")); // Invalidregister_shutdown_function(array('bar','foo')); // Invalidregister_shutdown_function(array(0,"some string")); // Invalidregister_shutdown_function('bar'); // Validregister_shutdown_function('foo'); // Validregister_shutdown_function(array('bar','barfoo')); // Valid$obj = new bar;register_shutdown_function(array($obj,'foobar')); // Invalidregister_shutdown_function(array($obj,'barfoo')); // Valid?>--EXPECTF--Notice: Undefined variable: obj in %s on line %dWarning: register_shutdown_function() [/phpmanual/function.register-shutdown-function.html]: Invalid shutdown callback 'Array' passed in %s on line %dNotice: Undefined variable: obj in %s on line %dWarning: register_shutdown_function() [/phpmanual/function.register-shutdown-function.html]: Invalid shutdown callback 'Array' passed in %s on line %dWarning: register_shutdown_function() [/phpmanual/function.register-shutdown-function.html]: Invalid shutdown callback 'Array' passed in %s on line %dWarning: register_shutdown_function() [/phpmanual/function.register-shutdown-function.html]: Invalid shutdown callback 'Array' passed in %s on line %dWarning: (Registered shutdown functions) Unable to call bar::foo() - function does not exist in Unknown on line 0Warning: (Registered shutdown functions) Unable to call bar() - function does not exist in Unknown on line 0joo!bar!Warning: (Registered shutdown functions) Unable to call bar::foobar() - function does not exist in Unknown on line 0bar!
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -