bug73987_1.phpt 476 B

123456789101112131415161718
  1. --TEST--
  2. Bug #73987 (Method compatibility check looks to original definition and not parent - return types interface)
  3. --FILE--
  4. <?php
  5. interface I {
  6. public function example();
  7. }
  8. class A implements I {
  9. public function example(): int { } // compatible with I::example
  10. }
  11. class B extends A {
  12. public function example(): string { } // compatible with I::example
  13. }
  14. ?>
  15. --EXPECTF--
  16. Fatal error: Declaration of B::example(): string must be compatible with A::example(): int in %s