We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ed8144e commit 1235334Copy full SHA for 1235334
src/test/php/lang/ast/unittest/emit/InitializeWithExpressionsTest.class.php
@@ -50,6 +50,19 @@ public function run() {
50
Assert::equals(new Handle(1), $r(new Handle(0)));
51
}
52
53
+ #[Test]
54
+ public function using_closures_referencing_this() {
55
+ $r= $this->run('use lang\ast\unittest\emit\Handle; class <T> {
56
+ private $id= 1;
57
+ private $h= fn() => new Handle($this->id);
58
+
59
+ public function run() {
60
+ return $this->h;
61
+ }
62
+ }');
63
+ Assert::equals(new Handle(1), $r());
64
65
66
#[Test]
67
public function using_anonymous_classes() {
68
$r= $this->run('class <T> {
0 commit comments