get_class_vars_003.phpt 646 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. --TEST--
  2. get_class_vars(): Testing the scope
  3. --FILE--
  4. <?php
  5. class A {
  6. public $a = 1;
  7. private $b = 2;
  8. private $c = 3;
  9. }
  10. class B extends A {
  11. static public $aa = 4;
  12. static private $bb = 5;
  13. static protected $cc = 6;
  14. protected function __construct() {
  15. var_dump(get_class_vars('C'));
  16. }
  17. }
  18. class C extends B {
  19. public $aaa = 7;
  20. private $bbb = 8;
  21. protected $ccc = 9;
  22. public function __construct() {
  23. parent::__construct();
  24. }
  25. }
  26. new C;
  27. ?>
  28. --EXPECT--
  29. array(6) {
  30. ["aaa"]=>
  31. int(7)
  32. ["ccc"]=>
  33. int(9)
  34. ["a"]=>
  35. int(1)
  36. ["aa"]=>
  37. int(4)
  38. ["bb"]=>
  39. int(5)
  40. ["cc"]=>
  41. int(6)
  42. }