File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
ext /
standard /
tests /
general_functions /
bug32647.phpt
Revision
1.1.1.1 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Tue Feb 21 23:48:04 2012 UTC (12 years, 6 months ago) by
misho
Branches:
php,
MAIN
CVS tags:
v5_4_3elwix,
v5_4_29p0,
v5_4_29,
v5_4_20p0,
v5_4_20,
v5_4_17p0,
v5_4_17,
v5_3_10,
HEAD
php
--TEST--
Bug #32647 (Using register_shutdown_function() with invalid callback can crash PHP)
--INI--
error_reporting=4095
display_errors=1
--FILE--
<?php
function foo()
{
echo "foo!\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'); // Invalid
register_shutdown_function('foo'); // Valid
register_shutdown_function(array('bar','barfoo')); // Invalid
$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 'bar::foo' 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 'bar' passed in %s on line %d
Strict Standards: Non-static method bar::barfoo() should not be called statically in %sbug32647.php on line %d
Warning: register_shutdown_function(): Invalid shutdown callback 'bar::foobar' passed in %sbug32647.php on line %d
foo!
Strict Standards: Non-static method bar::barfoo() should not be called statically in Unknown on line 0
Strict Standards: Non-static method bar::barfoo() should not be called statically in Unknown on line 0
bar!
bar!
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>