bug36434.phpt 533 B

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