File tree Expand file tree Collapse file tree
Zend/tests/partial_application Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,15 +5,36 @@ Partial application function name
55
66function g ($ a ) {}
77
8+ class C {
9+ static function m () {
10+ echo "# From a method: \n" ;
11+ var_dump((new ReflectionFunction (g(?)))->getName ());
12+ }
13+ }
14+
815function f() {
16+ echo "# From a function: \n" ;
917 var_dump((new ReflectionFunction (g(?)))->getName ());
18+
19+ echo "# Declared on same line: \n" ;
20+ [$ a , $ b ] = [g(?), g(?)];
21+ var_dump ((new ReflectionFunction ($ a ))->getName (), (new ReflectionFunction ($ b ))->getName ());
1022}
1123
1224f ();
25+ C::m ();
1326
27+ echo "# From global scope: \n" ;
1428var_dump((new ReflectionFunction (g(?)))->getName ());
1529
1630?>
17- --EXPECTF--
18- string(%d) "{closure:pfa:f():6}"
19- string(%d) "{closure:pfa:%sfunction_name.php:11}"
31+ --EXPECT--
32+ # From a function:
33+ string(20) "{closure:pfa:f():14}"
34+ # Declared on same line:
35+ string(20) "{closure:pfa:f():17}"
36+ string(20) "{closure:pfa:f():17}"
37+ # From a method:
38+ string(22) "{closure:pfa:C::m():8}"
39+ # From global scope:
40+ string(94) "{closure:pfa:%sfunction_name.php:25}"
You can’t perform that action at this time.
0 commit comments