3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function foo(&$param) { $param = 42; return $param; } $a = 23; echo \$a before calling foo(): $a\n"; $b = &foo($a); echo "\$a after the call to foo(): $a\n"; $b = 23; echo "\$a after touching the returned variable: $a\n"; echo "\$b : $b\n";
Output for 5.4.0 - 5.4.25
Parse error: syntax error, unexpected '$a' (T_VARIABLE), expecting identifier (T_STRING) in /in/e7qnj on line 8
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE, expecting T_STRING in /in/e7qnj on line 8
Process exited with code 255.