1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
archived-php-src/ext/reflection/tests/ReflectionProperty_isReadable_lazy.phpt
2026-02-27 14:26:06 +01:00

30 lines
512 B
PHP

--TEST--
Test ReflectionProperty::isReadable() lazy
--CREDITS--
Arnaud Le Blanc (arnaud-lb)
--FILE--
<?php
class A {
public int $a;
public int $b;
public function __construct() {
$this->a = 1;
}
}
$rc = new ReflectionClass(A::class);
$obj = $rc->newLazyProxy(fn() => new A());
$rp = new ReflectionProperty(A::class, 'a');
var_dump($rp->isReadable(null, $obj));
$rp = new ReflectionProperty(A::class, 'b');
var_dump($rp->isReadable(null, $obj));
?>
--EXPECT--
bool(true)
bool(false)