Skip to content

Commit 91ddb33

Browse files
committed
Expand test
1 parent 96c60c0 commit 91ddb33

1 file changed

Lines changed: 24 additions & 3 deletions

File tree

Zend/tests/partial_application/function_name.phpt

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,36 @@ Partial application function name
55

66
function 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+
815
function 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

1224
f();
25+
C::m();
1326

27+
echo "# From global scope:\n";
1428
var_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}"

0 commit comments

Comments
 (0)