3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ParentClass { function foo(string $arg): string {} } class ChildClass extends ParentClass { // typehints are missing function foo($arg) {} }
Output for 7.1.25, 7.2.0 - 7.2.15, 7.3.0 - 7.3.2
Fatal error: Declaration of ChildClass::foo($arg) must be compatible with ParentClass::foo(string $arg): string in /in/Tg6Rr on line 15
Process exited with code 255.

preferences:
171.48 ms | 1395 KiB | 27 Q