mirror of
https://github.com/php/php-src.git
synced 2024-12-17 22:09:12 +08:00
32 lines
482 B
PHP
32 lines
482 B
PHP
--TEST--
|
|
Reflection Bug #36434 (Properties from parent class fail to indetify their true origin)
|
|
--FILE--
|
|
<?php
|
|
class ancester
|
|
{
|
|
public $ancester = 0;
|
|
function ancester()
|
|
{
|
|
return $this->ancester;
|
|
}
|
|
}
|
|
class foo extends ancester
|
|
{
|
|
public $bar = "1";
|
|
function foo()
|
|
{
|
|
return $this->bar;
|
|
}
|
|
}
|
|
|
|
$r = new ReflectionClass('foo');
|
|
foreach ($r->GetProperties() as $p)
|
|
{
|
|
echo $p->getName(). " ". $p->getDeclaringClass()->getName()."\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
bar foo
|
|
ancester ancester
|