inter_01.phpt 392 B

123456789101112131415161718
  1. --TEST--
  2. Inherited constant from interface
  3. --FILE--
  4. <?php
  5. interface foo {
  6. const foo = 'foobar';
  7. public function bar($x = foo);
  8. }
  9. class foobar implements foo {
  10. const foo = 'bar';
  11. public function bar($x = foo::foo) {
  12. var_dump($x);
  13. }
  14. }
  15. ?>
  16. --EXPECTF--
  17. Fatal error: Cannot inherit previously-inherited or override constant foo from interface foo in %s on line %d