xref: /PHP-8.3/ext/reflection/tests/bug36434.phpt (revision f8d79582)
1--TEST--
2Reflection Bug #36434 (Properties from parent class fail to indetify their true origin)
3--FILE--
4<?php
5class ancester
6{
7    public $ancester = 0;
8    function __construct()
9    {
10        return $this->ancester;
11    }
12}
13class foo extends ancester
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
31ancester ancester
32