3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $fn = (function() { $i = 0; return function() use(&$i) { return $i++; }; })(); var_dump($fn()); var_dump($fn()); var_dump($fn());
based on MV8Nv
Output for 7.0.0 - 7.2.0
int(0) int(1) int(2)
Output for 5.3.18 - 5.6.21
Parse error: syntax error, unexpected '(' in /in/INBqA on line 8
Process exited with code 255.