3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function foo (&$val=NULL) { var_dump($val); } foo(); foo($val); foo($val = NULL); foo($val = array());
Output for 7.0.0 - 7.1.0
NULL NULL Notice: Only variables should be passed by reference in /in/1mArI on line 8 NULL Notice: Only variables should be passed by reference in /in/1mArI on line 9 array(0) { }
Output for hhvm-3.10.0 - 3.12.0
NULL NULL Strict Warning: Only variables should be passed by reference in /in/1mArI on line 8 NULL Strict Warning: Only variables should be passed by reference in /in/1mArI on line 9 array(0) { }
Output for 5.1.2 - 5.6.28
NULL NULL Strict Standards: Only variables should be passed by reference in /in/1mArI on line 8 NULL Strict Standards: Only variables should be passed by reference in /in/1mArI on line 9 array(0) { }
Output for 5.0.0 - 5.1.1
NULL NULL NULL array(0) { }
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '=', expecting ')' in /in/1mArI on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected '=', expecting ')' in /in/1mArI on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/1mArI on line 2
Process exited with code 255.