summaryrefslogtreecommitdiff
path: root/ext/reflection/tests/bug72174.phpt
blob: dacfc0e55e096a7ed6efe56b6dc0358e28d1cebb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
--TEST--
Bug #72174: ReflectionProperty#getValue() causes __isset call
--FILE--
<?php

class Foo
{
    private $bar;

    public function __construct()
    {
        unset($this->bar);
    }

    public function __isset($name)
    {
        var_dump(__METHOD__);
        return true;
    }

    public function __get($name)
    {
        var_dump(__METHOD__);
        return $name;
    }
}

$instance = new Foo();
$reflectionBar = (new ReflectionProperty(Foo::class, 'bar'));
$reflectionBar->setAccessible(true);
var_dump($reflectionBar->getValue($instance));

?>
--EXPECT--
string(10) "Foo::__get"
string(3) "bar"