3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function foo():string{ return ''; } } class B extends A { public function foo():int{ return 1; } }
Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.29, 8.2.0 - 8.2.22, 8.3.0 - 8.3.10
Fatal error: Declaration of B::foo(): int must be compatible with A::foo(): string in /in/nP9up on line 10
Process exited with code 255.

preferences:
171.74 ms | 1070 KiB | 8 Q