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