bug33732.phpt 557 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. --TEST--
  2. Bug #33732 (Wrong behavior of constants in class and interface extending)
  3. --FILE--
  4. <?php
  5. interface iA {
  6. const cA = "const of iA\n";
  7. }
  8. class A implements iA {
  9. }
  10. class B extends A implements iA {
  11. }
  12. echo iA::cA;
  13. echo A::cA;
  14. echo B::cA;
  15. interface iA2 {
  16. const cA = "const of iA2\n";
  17. }
  18. interface iB2 extends iA2 {
  19. }
  20. class A2 implements iA2 {
  21. }
  22. class B2 extends A2 implements iA2 {
  23. }
  24. echo iA2::cA;
  25. echo A2::cA;
  26. echo iB2::cA;
  27. echo B2::cA;
  28. ?>
  29. --EXPECT--
  30. const of iA
  31. const of iA
  32. const of iA
  33. const of iA2
  34. const of iA2
  35. const of iA2
  36. const of iA2