bug49472.phpt 433 B

123456789101112131415161718192021222324252627
  1. --TEST--
  2. Bug #49472 (Constants defined in Interfaces can be overridden)
  3. --FILE--
  4. <?php
  5. interface ia {
  6. const c = 'Sea';
  7. const y = 2;
  8. }
  9. class Foo implements ia {
  10. }
  11. class FooBar extends Foo implements ia {
  12. const x = 1;
  13. const c = 'Ocean';
  14. public function show() {
  15. return ia::c;
  16. }
  17. }
  18. new FooBar;
  19. ?>
  20. --EXPECTF--
  21. Fatal error: Cannot inherit previously-inherited or override constant c from interface ia in %s on line %d