PageRenderTime 41ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/hphp/test/zend/bad/ext/reflection/tests/ReflectionClass_getDefaultProperties_001.php

http://github.com/facebook/hiphop-php
PHP | 69 lines | 54 code | 15 blank | 0 comment | 0 complexity | 67a4b6e282a74309d472a337f3c33320 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
  1. <?php
  2. class A {
  3. static public $statPubC = "stat pubC in A";
  4. static protected $statProtC = "stat protC in A";
  5. static private $statPrivC = "stat privC in A";
  6. static public $statPubA = "stat pubA in A";
  7. static protected $statProtA = "stat protA in A";
  8. static private $statPrivA = "stat privA in A";
  9. public $pubC = "pubC in A";
  10. protected $protC = "protC in A";
  11. private $privC = "privC in A";
  12. public $pubA = "pubA in A";
  13. protected $protA = "protA in A";
  14. private $privA = "privA in A";
  15. }
  16. class B extends A {
  17. static public $statPubC = "stat pubC in B";
  18. static protected $statProtC = "stat protC in B";
  19. static private $statPrivC = "stat privC in B";
  20. static public $statPubB = "stat pubB in B";
  21. static protected $statProtB = "stat protB in B";
  22. static private $statPrivB = "stat privB in B";
  23. public $pubC = "pubC in B";
  24. protected $protC = "protC in B";
  25. private $privC = "privC in B";
  26. public $pubB = "pubB in B";
  27. protected $protB = "protB in B";
  28. private $privB = "privB in B";
  29. }
  30. class C extends B {
  31. static public $statPubC = "stat pubC in C";
  32. static protected $statProtC = "stat protC in C";
  33. static private $statPrivC = "stat privC in C";
  34. public $pubC = "pubC in C";
  35. protected $protC = "protC in C";
  36. private $privC = "privC in C";
  37. }
  38. class X {
  39. static public $statPubC = "stat pubC in X";
  40. static protected $statProtC = "stat protC in X";
  41. static private $statPrivC = "stat privC in X";
  42. public $pubC = "pubC in X";
  43. protected $protC = "protC in X";
  44. private $privC = "privC in X";
  45. }
  46. $classes = array('A', 'B', 'C', 'X');
  47. foreach ($classes as $class) {
  48. $rc = new ReflectionClass($class);
  49. echo "\n\n---- Static properties in $class ----\n";
  50. print_r($rc->getStaticProperties());
  51. echo "\n\n---- Default properties in $class ----\n";
  52. print_r($rc->getDefaultProperties());
  53. }
  54. ?>