mirror of
https://github.com/php/php-src.git
synced 2026-10-28 17:56:50 +08:00
RFC: https://wiki.php.net/rfc/isreadable-iswriteable Fixes GH-15309 Fixes GH-16175 Closes GH-16209
26 lines
429 B
PHP
26 lines
429 B
PHP
--TEST--
|
|
Test ReflectionProperty::isReadable() lazy dynamic
|
|
--CREDITS--
|
|
Arnaud Le Blanc (arnaud-lb)
|
|
--FILE--
|
|
<?php
|
|
|
|
#[AllowDynamicProperties]
|
|
class A {
|
|
public $_;
|
|
|
|
public function __construct() {
|
|
$this->prop = 1;
|
|
}
|
|
}
|
|
|
|
$rc = new ReflectionClass(A::class);
|
|
$obj = $rc->newLazyProxy(fn() => new A());
|
|
|
|
$rp = new ReflectionProperty(new A, 'prop');
|
|
var_dump($rp->isReadable(null, $obj));
|
|
|
|
?>
|
|
--EXPECT--
|
|
bool(true)
|