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