ru_php/ext/reflection/tests/ReflectionProperty_isReadable_lazy_dynamic.phpt

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)