xref: /php-src/ext/reflection/tests/bug36434.phpt (revision 8b8a6733)
1--TEST--
2Reflection Bug #36434 (Properties from parent class fail to identify their true origin)
3--FILE--
4<?php
5class ancestor
6{
7    public $ancestor = 0;
8    function __construct()
9    {
10        return $this->ancestor;
11    }
12}
13class foo extends ancestor
14{
15    public $bar = "1";
16    function __construct()
17    {
18        return $this->bar;
19    }
20}
21
22$r = new ReflectionClass('foo');
23foreach ($r->GetProperties() as $p)
24{
25    echo $p->getName(). " ". $p->getDeclaringClass()->getName()."\n";
26}
27
28?>
29--EXPECT--
30bar foo
31ancestor ancestor
32