Skip to content

Commit 28fd87f

Browse files
committed
Improve test
1 parent 4d0ccda commit 28fd87f

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

Zend/tests/partial_application/static_pfa_004.phpt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,26 @@ $c = function ($a) {
77
try {
88
var_dump($this, $this === $a);
99
} catch (Error $e) {
10-
var_dump(null, false);
10+
echo $e::class, ": ", $e->getMessage(), "\n";
1111
}
1212
};
1313

14+
echo "# Original PFA\n";
15+
1416
$f = $c(?);
1517
echo new ReflectionFunction($f), "\n";
1618
$f($c);
1719

20+
echo "# Re-bound PFA\n";
21+
1822
$c2 = new class {};
1923
$f->bindTo($c2)($c2);
2024

2125
?>
2226
--EXPECTF--
23-
Closure [ <user> function {closure:pfa:%s:11} ] {
24-
@@ %s 11 - 11
27+
# Original PFA
28+
Closure [ <user> function {closure:pfa:%s:13} ] {
29+
@@ %s 13 - 13
2530

2631
- Bound Variables [1] {
2732
Variable #0 [ $fn ]
@@ -32,8 +37,8 @@ Closure [ <user> function {closure:pfa:%s:11} ] {
3237
}
3338
}
3439

35-
NULL
36-
bool(false)
40+
Error: Using $this when not in object context
41+
# Re-bound PFA
3742
object(class@anonymous)#3 (0) {
3843
}
3944
bool(true)

0 commit comments

Comments
 (0)