cvs: php-src(PHP_4_3) /ext/standard/tests/general_functions bug32647.phpt
| From: | Jani Taskinen | Date: | Thu, 21 Apr 2005 14:18:51 +0000 |
| Subject: | cvs: php-src(PHP_4_3) /ext/standard/tests/general_functions bug32647.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-31525@lists.php.net to get a copy of this message | ||
sniper Thu Apr 21 10:18:51 2005 EDT
Added files: (Branch: PHP_4_3)
/php-src/ext/standard/tests/general_functions bug32647.phpt
Log:
MFH: Added test for bug #32647
http://cvs.php.net/co.php/php-src/ext/standard/tests/general_functions/bug32647.phpt?r=1.1&p=1
Index: php-src/ext/standard/tests/general_functions/bug32647.phpt
+++ php-src/ext/standard/tests/general_functions/bug32647.phpt
--TEST--
Bug #32647 (Using register_shutdown_function() with invalid callback can crash PHP)
--INI--
error_reporting=2047
display_errors=1
--FILE--
<?php
function foo()
{
echo "joo!\n";
}
class bar
{
function barfoo ()
{ echo "bar!\n"; }
}
unset($obj);
register_shutdown_function(array($obj,"")); // Invalid
register_shutdown_function(array($obj,"some string")); // Invalid
register_shutdown_function(array(0,"")); // Invalid
register_shutdown_function(array('bar','foo')); // Invalid
register_shutdown_function(array(0,"some string")); // Invalid
register_shutdown_function('bar'); // Valid
register_shutdown_function('foo'); // Valid
register_shutdown_function(array('bar','barfoo')); // Valid
$obj = new bar;
register_shutdown_function(array($obj,'foobar')); // Invalid
register_shutdown_function(array($obj,'barfoo')); // Valid
?>
--EXPECTF--
Notice: Undefined variable: obj in %s on line %d
Warning: register_shutdown_function(): Invalid shutdown callback 'Array' passed in %s on
line %d
Notice: Undefined variable: obj in %s on line %d
Warning: register_shutdown_function(): Invalid shutdown callback 'Array' passed in %s on
line %d
Warning: register_shutdown_function(): Invalid shutdown callback 'Array' passed in %s on
line %d
Warning: register_shutdown_function(): Invalid shutdown callback 'Array' passed in %s on
line %d
Warning: (Registered shutdown functions) Unable to call bar::foo() - function does not exist in
Unknown on line 0
Warning: (Registered shutdown functions) Unable to call bar() - function does not exist in Unknown
on line 0
joo!
bar!
Warning: (Registered shutdown functions) Unable to call bar::foobar() - function does not exist in
Unknown on line 0
bar!