File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ --TEST--
2+ GH-22000 - Ensure __isset is not returning a reference in ReflectionProperty::isReadable()
3+ --FILE--
4+ <?php
5+ class TestClass {
6+ public int $ a ;
7+ public int $ b ;
8+ public int $ c ;
9+
10+ public function __construct () {
11+ unset($ this ->b );
12+ unset($ this ->c );
13+ }
14+
15+ public function &__isset ($ name ) {
16+ return $ name === 'c ' ;
17+ }
18+
19+ public function __get ($ name ) {}
20+ }
21+
22+
23+ function test ($ class ) {
24+ try {
25+ $ rc = new ReflectionClass ($ class );
26+ foreach ($ rc ->getProperties () as $ rp ) {
27+ echo $ rp ->getName () . ' from global: ' ;
28+ var_dump ($ rp ->isReadable (null , new $ class ));
29+ }
30+ } catch (\Exception $ ex ) {
31+ echo $ ex ->getMessage ();
32+ }
33+ }
34+
35+ test ('TestClass ' );
36+ ?>
37+ --EXPECTF--
38+ a from global: bool(false)
39+ b from global: __isset should not return a reference
You can’t perform that action at this time.
0 commit comments