php-src/Zend/tests/bug80126_2.phpt
Nikita Popov 3b7c8bb973 Fix bug #80126
When performing an unlinked instanceof, we also need to consider
interfaces of parent classes, as they may not have been inherited
yet.
2020-10-06 16:33:14 +02:00

28 lines
400 B
PHP

--TEST--
Bug #80126: Covariant return types failing compilation (variation 2)
--FILE--
<?php
interface I {
public function method(): I;
}
abstract class A implements I {
public function method(): I {
return new static();
}
}
class C extends A { }
interface I2 { }
class C2 extends C implements I2 {
public function method(): C2 { }
}
?>
===DONE===
--EXPECT--
===DONE===