diff --git a/stub/closures.zep b/stub/closures.zep index f37c3d88e..195c57aa5 100644 --- a/stub/closures.zep +++ b/stub/closures.zep @@ -5,6 +5,7 @@ class Closures { protected _argument; protected _function; + protected property1873 = "call from closure"; public function simple1() { @@ -97,4 +98,11 @@ class Closures { return call_user_func(this->_function, this->_argument); } + + public function issue1873() -> string + { + return function () { + return this->property1873; + }; + } } diff --git a/tests/Extension/ClosureTest.php b/tests/Extension/ClosureTest.php index e84ce190d..4004716d7 100644 --- a/tests/Extension/ClosureTest.php +++ b/tests/Extension/ClosureTest.php @@ -40,4 +40,11 @@ public function testIssue1036(): void $this->assertTrue($test->issue1036Call()); } + + public function testIssue1873(): void + { + $test = new Closures(); + + $this->assertInstanceOf(\Closure::class, $test->issue1873()); + } }