3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface A { public function select(string $table) : self; } class B extends A { /** * @return B */ public function select(string $table) : parent {} }
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.30, 7.2.0 - 7.2.19, 7.3.0 - 7.3.6
Fatal error: Class B cannot extend from interface A in /in/VGnR1 on line 15
Process exited with code 255.
Output for 5.6.38 - 5.6.40
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/VGnR1 on line 5
Process exited with code 255.

preferences:
203.88 ms | 1395 KiB | 102 Q