3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $actions = array(); for ($x = 1; $x < 3; ++$x){ $actions[] = function(){ echo 'this is action 425 to 724'; // etc etc.. }; } debug_zval_dump($actions[0]); debug_zval_dump($actions[1]);
Output for 5.3.0 - 5.6.29, 7.0.0 - 7.1.0
object(Closure)#1 (0) refcount(2){ } object(Closure)#2 (0) refcount(2){ }
Output for hhvm-3.12.0 - 3.13.2
object(Closure$;1192474332$fb67ba2acfa7a95f448c84c474deeb55$)#1 (1) refcount(2){ [0]=> object(Closure$;1192474332$fb67ba2acfa7a95f448c84c474deeb55$)#1 (1) refcount(4){ [0]=> *RECURSION* } } object(Closure$;1192474332$fb67ba2acfa7a95f448c84c474deeb55$)#2 (1) refcount(2){ [0]=> object(Closure$;1192474332$fb67ba2acfa7a95f448c84c474deeb55$)#2 (1) refcount(4){ [0]=> *RECURSION* } }
Output for hhvm-3.10.0
object(Closure$;1192474332$f64794ec6bd6bcaadd8b8f5dd5199b6a$)#1 (1) refcount(2){ [0]=> object(Closure$;1192474332$f64794ec6bd6bcaadd8b8f5dd5199b6a$)#1 (1) refcount(4){ [0]=> *RECURSION* } } object(Closure$;1192474332$f64794ec6bd6bcaadd8b8f5dd5199b6a$)#2 (1) refcount(2){ [0]=> object(Closure$;1192474332$f64794ec6bd6bcaadd8b8f5dd5199b6a$)#2 (1) refcount(4){ [0]=> *RECURSION* } }
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/NW9vj on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION in /in/NW9vj on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/NW9vj on line 6
Process exited with code 255.