3v4l.org

run code in 200+ 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.30, 7.0.0 - 7.2.1
object(Closure)#1 (0) refcount(2){ } object(Closure)#2 (0) refcount(2){ }
Output for hhvm-3.21.0 - 3.22.0
object(Closure$;4)#1 (1) refcount(2){ [0]=> object(Closure$;4)#1 (1) refcount(5){ [0]=> *RECURSION* } } object(Closure$;4)#2 (1) refcount(2){ [0]=> object(Closure$;4)#2 (1) refcount(5){ [0]=> *RECURSION* } }
Output for hhvm-3.18.4 - 3.20.2
object(Closure$;2)#1 (1) refcount(2){ [0]=> object(Closure$;2)#1 (1) refcount(5){ [0]=> *RECURSION* } } object(Closure$;2)#2 (1) refcount(2){ [0]=> object(Closure$;2)#2 (1) refcount(5){ [0]=> *RECURSION* } }
Output for hhvm-3.17.3
object(Closure$;2)#1 (1) refcount(2){ [0]=> object(Closure$;2)#1 (1) refcount(4){ [0]=> *RECURSION* } } object(Closure$;2)#2 (1) refcount(2){ [0]=> object(Closure$;2)#2 (1) refcount(4){ [0]=> *RECURSION* } }
Output for hhvm-3.15.4
object(Closure$;1192474332$61785e929ee8e35efc4cf17660a70e09$)#1 (1) refcount(2){ [0]=> object(Closure$;1192474332$61785e929ee8e35efc4cf17660a70e09$)#1 (1) refcount(4){ [0]=> *RECURSION* } } object(Closure$;1192474332$61785e929ee8e35efc4cf17660a70e09$)#2 (1) refcount(2){ [0]=> object(Closure$;1192474332$61785e929ee8e35efc4cf17660a70e09$)#2 (1) refcount(4){ [0]=> *RECURSION* } }
Output for hhvm-3.12.14 - 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.11.1
object(Closure$;1192474332$34b0c136db28633fd087cfd0356e44af$)#1 (1) refcount(2){ [0]=> object(Closure$;1192474332$34b0c136db28633fd087cfd0356e44af$)#1 (1) refcount(4){ [0]=> *RECURSION* } } object(Closure$;1192474332$34b0c136db28633fd087cfd0356e44af$)#2 (1) refcount(2){ [0]=> object(Closure$;1192474332$34b0c136db28633fd087cfd0356e44af$)#2 (1) refcount(4){ [0]=> *RECURSION* } }
Output for hhvm-3.10.1
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.