xref: /PHP-7.4/Zend/tests/bug80126_2.phpt (revision 3b7c8bb9)
1--TEST--
2Bug #80126: Covariant return types failing compilation (variation 2)
3--FILE--
4<?php
5
6interface I {
7    public function method(): I;
8}
9
10abstract class A implements I {
11    public function method(): I {
12        return new static();
13    }
14}
15
16class C extends A { }
17
18interface I2 { }
19
20class C2 extends C implements I2 {
21    public function method(): C2 { }
22}
23
24?>
25===DONE===
26--EXPECT--
27===DONE===
28