3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { abstract public function test(); } class Bar extends Foo { public function test(): Foo { return $this; } } var_dump((new Bar())->test());
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.

preferences:
159.88 ms | 1395 KiB | 32 Q