3v4l.org

run code in 300+ PHP versions simultaneously
<?php $blah = false; echo “calling function \n”; try { test($blah); }catch(\Error $e){ echo “Caught\n”; print_r($e); } function test(array $val){ echo “inside test \n”; print_r($val); echo “\n”; } echo “done\n”;
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.7
Parse error: syntax error, unexpected 'function' (T_FUNCTION), expecting ',' or ';' in /in/DOHTR on line 4
Process exited with code 255.

preferences:
171.95 ms | 1387 KiB | 36 Q