mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
780a8280d2
RFC: https://wiki.php.net/rfc/property-hooks Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
26 lines
347 B
PHP
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"
|