3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f($x) { echo $x; } $funs = array(); for ($i=0; $i<10; $i++) { $funs[] = function() { f($i); } } for ($i=0; $i<10; $i++) { $g = $funs[$i]; //$g(); }
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.25
Parse error: syntax error, unexpected '}' in /in/HKJH6 on line 10
Process exited with code 255.

preferences:
190.09 ms | 1395 KiB | 62 Q