error_014.phpt 357 B

1234567891011121314151617181920212223
  1. --TEST--
  2. Trying to override final method
  3. --FILE--
  4. <?php
  5. trait foo {
  6. public function test() { return 3; }
  7. }
  8. class baz {
  9. final public function test() { return 4; }
  10. }
  11. class bar extends baz {
  12. use foo { test as public; }
  13. }
  14. $x = new bar;
  15. var_dump($x->test());
  16. ?>
  17. --EXPECTF--
  18. Fatal error: Cannot override final method baz::test() in %s on line %d