xref: /PHP-7.0/ext/reflection/tests/bug72174.phpt (revision a1ed4ab3)
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'));
30$reflectionBar->setAccessible(true);
31var_dump($reflectionBar->getValue($instance));
32
33?>
34--EXPECT--
35string(10) "Foo::__get"
36string(3) "bar"
37