3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $cl = function($b) { return function() use (&$b) { ++$b; echo $b . PHP_EOL; }; }; $i = $cl(1); $i(); $i(); $v = 1; $s = function() use (&$v) { ++$v; echo $v . PHP_EOL; } $s(); $s();
Output for 5.4.0 - 5.4.26
Parse error: syntax error, unexpected '$s' (T_VARIABLE) in /in/OfApC on line 22
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE in /in/OfApC on line 22
Process exited with code 255.