3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo (?string $test) { var_dump($test); } foo()
Output for 7.1.0 - 7.1.23, 7.2.0 - 7.2.11
Parse error: syntax error, unexpected end of file in /in/HkQT3 on line 7
Process exited with code 255.
Output for 5.6.38
Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in /in/HkQT3 on line 3
Process exited with code 255.

preferences:
174.29 ms | 1386 KiB | 44 Q