summaryrefslogtreecommitdiff
path: root/ext/reflection/tests/bug75231.phpt
blob: 5aff0be19c2d760ed433531b78b7714ea5e92084 (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
--TEST--
Bug #75231: ReflectionProperty#getValue() incorrectly works with inherited classes
--FILE--
<?php
class A
{
    public $prop;
    public function __construct()
    {
        $this->prop = 'prop';
    }
    public function method()
    {
        return 'method';
    }
}
class B extends A
{
}
print_r((new ReflectionMethod(B::class, 'method'))->invoke(new A()).PHP_EOL);
print_r((new ReflectionProperty(B::class, 'prop'))->getValue(new A()).PHP_EOL);
?>
--EXPECT--
method
prop