3v4l.org

run code in 200+ php & hhvm versions
<?php function foo(): ?array { return array(); } function bar(): ?array { return null; } foo(); bar();
Output for hhvm-3.20.2 - 3.22.0, 7.1.0 - 7.4.0alpha2
Output for 7.0.0 - 7.0.33
Parse error: syntax error, unexpected '?' in /in/YiD0p on line 3
Process exited with code 255.
Output for hhvm-3.11.1 - 3.19.2
Fatal error: Uncaught Error: Syntax only allowed in Hack files (<?hh) or with -v Eval.EnableHipHopSyntax=true in /in/YiD0p:3 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.10.1
Fatal error: Syntax only allowed in Hack files (<?hh) or with -v Eval.EnableHipHopSyntax=true in /in/YiD0p on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.6.40
Parse error: syntax error, unexpected ':', expecting '{' in /in/YiD0p on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected ':', expecting '{' in /in/YiD0p on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `'{'' in /in/YiD0p on line 3
Process exited with code 255.