php-src/Zend/tests/property_hooks/property_access_within_closure.phpt
Ilija Tovilo 780a8280d2
[RFC] Property hooks (#13455)
RFC: https://wiki.php.net/rfc/property-hooks

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2024-07-14 11:55:03 +02:00

26 lines
347 B
PHP

--TEST--
Property access within closure
--FILE--
<?php
class A {
public $prop {
get {
return function () {
return $this->prop;
};
}
}
}
$a = new A();
$c = $a->prop;
var_dump(get_class($c));
$d = $c();
var_dump(get_class($d));
?>
--EXPECT--
string(7) "Closure"
string(7) "Closure"