bug79862.phpt 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. --TEST--
  2. Bug #79862: Public non-static property in child should take priority over private static
  3. --FILE--
  4. <?php
  5. class a {
  6. private static $prop1;
  7. private static $prop2;
  8. private $prop3;
  9. private $prop4;
  10. private static $prop5;
  11. private static $prop6;
  12. public function __construct() {
  13. $this->prop1 = 1;
  14. $this->prop2 = 2;
  15. $this->prop3 = 3;
  16. $this->prop4 = 4;
  17. $this->prop5 = 5;
  18. $this->prop6 = 6;
  19. var_dump(self::$prop1);
  20. var_dump(self::$prop2);
  21. var_dump(self::$prop5);
  22. var_dump(self::$prop6);
  23. var_dump($this);
  24. }
  25. }
  26. class c extends a {
  27. public $prop1;
  28. protected $prop2;
  29. public static $prop3;
  30. protected static $prop4;
  31. public static $prop5;
  32. protected static $prop6;
  33. }
  34. $c = new c;
  35. ?>
  36. --EXPECTF--
  37. Notice: Accessing static property c::$prop5 as non static in %s on line %d
  38. Notice: Accessing static property c::$prop6 as non static in %s on line %d
  39. NULL
  40. NULL
  41. NULL
  42. NULL
  43. object(c)#1 (6) {
  44. ["prop3":"a":private]=>
  45. int(3)
  46. ["prop4":"a":private]=>
  47. int(4)
  48. ["prop1"]=>
  49. int(1)
  50. ["prop2":protected]=>
  51. int(2)
  52. ["prop5"]=>
  53. int(5)
  54. ["prop6"]=>
  55. int(6)
  56. }