method_override_optional_arg_002.phpt 344 B

12345678910111213141516171819202122
  1. --TEST--
  2. Omitting optional arg in method inherited from abstract class
  3. --FILE--
  4. <?php
  5. abstract class A {
  6. function foo($arg = 1) {}
  7. }
  8. class B extends A {
  9. function foo() {
  10. echo "foo\n";
  11. }
  12. }
  13. $b = new B();
  14. $b->foo();
  15. ?>
  16. --EXPECTF--
  17. Strict Standards: Declaration of B::foo() should be compatible with A::foo($arg = 1) in %s on line %d
  18. foo