- Output for 7.1.0 - 7.1.17, 7.2.0 - 7.2.6
- Fatal error: Class Foo contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Foo::test) in /in/3bJAa on line 5
Process exited with code 255.
<?php
class Foo {
abstract public function test();
}
class Bar extends Foo {
public function test(): Foo {
return $this;
}
}
var_dump((new Bar())->test());