bug72119.phpt 406 B

123456789101112131415161718
  1. --TEST--
  2. Bug #72119 (Interface declaration compatibility regression with default values)
  3. --FILE--
  4. <?php
  5. interface Foo {
  6. public function bar(array $baz = null);
  7. }
  8. class Hello implements Foo {
  9. public function bar(array $baz = [])
  10. {
  11. }
  12. }
  13. echo "OK\n";
  14. ?>
  15. --EXPECTF--
  16. Fatal error: Declaration of Hello::bar(array $baz = []) must be compatible with Foo::bar(?array $baz = null) in %s on line %d