xref: /PHP-8.2/ext/reflection/tests/bug72174.phpt (revision 6e16e1da)
1--TEST--
2Bug #72174: ReflectionProperty#getValue() causes __isset call
3--FILE--
4<?php
5
6class Foo
7{
8    private $bar;
9
10    public function __construct()
11    {
12        unset($this->bar);
13    }
14
15    public function __isset($name)
16    {
17        var_dump(__METHOD__);
18        return true;
19    }
20
21    public function __get($name)
22    {
23        var_dump(__METHOD__);
24        return $name;
25    }
26}
27
28$instance = new Foo();
29$reflectionBar = (new ReflectionProperty(Foo::class, 'bar'));
30var_dump($reflectionBar->getValue($instance));
31
32?>
33--EXPECT--
34string(10) "Foo::__get"
35string(3) "bar"
36