mirror of
https://github.com/php/php-src.git
synced 2024-09-24 11:27:28 +00:00
17b3791a01
See feedback by @nikic, https://github.com/php/php-src/pull/647#issuecomment-48050551
48 lines
646 B
PHP
Executable File
48 lines
646 B
PHP
Executable File
--TEST--
|
|
Catch method calls on non-objects as argument
|
|
--FILE--
|
|
<?php
|
|
function nesting() {
|
|
return func_get_args();
|
|
}
|
|
set_error_handler(function($code, $message) {
|
|
static $i= 0;
|
|
echo 'Called #'.(++$i)."\n";
|
|
});
|
|
|
|
$x= null;
|
|
var_dump(nesting($x->method()));
|
|
var_dump(nesting(nesting($x->method())));
|
|
var_dump(nesting($x->method(nesting($x->method()))));
|
|
var_dump(nesting($x->method(), $x->method()));
|
|
echo "Alive\n";
|
|
?>
|
|
--EXPECTF--
|
|
Called #1
|
|
array(1) {
|
|
[0]=>
|
|
NULL
|
|
}
|
|
Called #2
|
|
array(1) {
|
|
[0]=>
|
|
array(1) {
|
|
[0]=>
|
|
NULL
|
|
}
|
|
}
|
|
Called #3
|
|
array(1) {
|
|
[0]=>
|
|
NULL
|
|
}
|
|
Called #4
|
|
Called #5
|
|
array(2) {
|
|
[0]=>
|
|
NULL
|
|
[1]=>
|
|
NULL
|
|
}
|
|
Alive
|