blob: a4529eecdca7efc85d2be2a6967710f1158787bf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
--TEST--
Catch method calls on non-objects with nested non-compile-time-resolveable calls
--FILE--
<?php
require('methods-on-non-objects-nested.inc');
set_error_handler(function($code, $message) {
static $i= 0;
echo 'Called #'.(++$i)."\n";
});
$x= null;
var_dump($x->method(nested()));
$closure= function() { return nested(); };
var_dump($x->method($closure()));
$lambda= create_function('', 'return nested();');
var_dump($x->method($lambda()));
$func= 'nested';
var_dump($x->method($func()));
var_dump($x->method(call_user_func('nested')));
var_dump($x->method(call_user_func_array('nested', [])));
echo "Alive\n";
?>
--EXPECTF--
Called #1
NULL
Called #2
NULL
Called #3
NULL
Called #4
NULL
Called #5
NULL
Called #6
NULL
Alive
|