interface_constant_inheritance_002.phpt 310 B

1234567891011121314151617
  1. --TEST--
  2. Ensure a class may not shadow a constant inherited from an interface.
  3. --FILE--
  4. <?php
  5. interface I {
  6. const FOO = 10;
  7. }
  8. class C implements I {
  9. const FOO = 10;
  10. }
  11. echo "Done\n";
  12. ?>
  13. --EXPECTF--
  14. Fatal error: Cannot inherit previously-inherited or override constant FOO from interface I in %s on line 6