bug60536_003.phpt 693 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. --TEST--
  2. Properties should be initialized correctly (relevant to #60536)
  3. --FILE--
  4. <?php
  5. class BaseWithPropA {
  6. private $hello = 0;
  7. }
  8. trait AHelloProperty {
  9. private $hello = 0;
  10. }
  11. class BaseWithTPropB {
  12. use AHelloProperty;
  13. }
  14. class SubclassA extends BaseWithPropA {
  15. use AHelloProperty;
  16. }
  17. class SubclassB extends BaseWithTPropB {
  18. use AHelloProperty;
  19. }
  20. $a = new SubclassA;
  21. var_dump($a);
  22. $b = new SubclassB;
  23. var_dump($b);
  24. ?>
  25. --EXPECTF--
  26. object(SubclassA)#%d (2) {
  27. ["hello":"BaseWithPropA":private]=>
  28. int(0)
  29. ["hello":"SubclassA":private]=>
  30. int(0)
  31. }
  32. object(SubclassB)#%d (2) {
  33. ["hello":"BaseWithTPropB":private]=>
  34. int(0)
  35. ["hello":"SubclassB":private]=>
  36. int(0)
  37. }