024.phpt 651 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --TEST--
  2. ReflectionObject::__toString (filtering privates/protected dynamic properties)
  3. --FILE--
  4. <?php
  5. class C1 {
  6. private $p1 = 1;
  7. protected $p2 = 2;
  8. public $p3 = 3;
  9. }
  10. $x = new C1();
  11. $x->z = 4;
  12. $x->p3 = 5;
  13. $obj = new ReflectionObject($x);
  14. echo $obj;
  15. ?>
  16. --EXPECTF--
  17. Object of class [ <user> class C1 ] {
  18. @@ %s024.php 2-6
  19. - Constants [0] {
  20. }
  21. - Static properties [0] {
  22. }
  23. - Static methods [0] {
  24. }
  25. - Properties [3] {
  26. Property [ private $p1 = 1 ]
  27. Property [ protected $p2 = 2 ]
  28. Property [ public $p3 = 3 ]
  29. }
  30. - Dynamic properties [1] {
  31. Property [ <dynamic> public $z ]
  32. }
  33. - Methods [0] {
  34. }
  35. }