3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $count = 0; $addone = function() use ($count) { $count ++; }; echo $count . "<br>"; $addone(); $addone(); echo $count. "<br>"; $addonefix = function() use (&$count) { $count ++; }; echo 'With Fix:' echo $count. "<br>"; $addonefix(); $addonefix(); echo $count. "<br>";
Output for 5.4.0 - 5.4.24
Parse error: syntax error, unexpected 'echo' (T_ECHO), expecting ',' or ';' in /in/hrUTu on line 20
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_ECHO, expecting ',' or ';' in /in/hrUTu on line 20
Process exited with code 255.