bug50810.phpt 804 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. --TEST--
  2. Bug #50810 (property_exists does not work for private)
  3. --FILE--
  4. <?php
  5. class ExampleSuperClass
  6. {
  7. private $foo;
  8. static protected $bar;
  9. private function foo()
  10. {
  11. }
  12. public function propertyFooExists()
  13. {
  14. return property_exists($this, 'foo');
  15. }
  16. }
  17. class ExampleSubClass extends ExampleSuperClass
  18. {
  19. public function methodExists()
  20. {
  21. return method_exists($this, 'foo');
  22. }
  23. public function propertyBarExists()
  24. {
  25. return property_exists($this, 'bar');
  26. }
  27. }
  28. $example = new ExampleSubClass();
  29. var_dump($example->methodExists());
  30. var_dump(method_exists($example, 'propertyFooExists'));
  31. var_dump($example->propertyFooExists());
  32. var_dump($example->propertyBarExists());
  33. ?>
  34. --EXPECT--
  35. bool(true)
  36. bool(true)
  37. bool(true)
  38. bool(true)