bug32647.phpt
来自「php-4.4.7学习linux时下载的源代码」· PHPT 代码 · 共 56 行
PHPT
56 行
--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 + =
减小字号Ctrl + -
显示快捷键?