3v4l.org

run code in 300+ PHP versions simultaneously
<?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(); $v = 1; function s() use (&$v) { ++$v; echo $v . PHP_EOL; }; s(); s();
Output for 5.4.0 - 5.4.26
Parse error: syntax error, unexpected 'use' (T_USE), expecting '{' in /in/LpUZQ on line 26
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_USE, expecting '{' in /in/LpUZQ on line 26
Process exited with code 255.

preferences:
187.26 ms | 1395 KiB | 63 Q