3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = function(){echo 'hi';}; var_dump($a); var_export($a); print_r($a); echo json_encode($a);
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
object(Closure)#1 (0) { } Closure::__set_state(array( ))Closure Object ( ) {}
Output for hhvm-3.12.0
object(Closure$;1598121689$8f92529ae4ba8245e382e2b978bcf883$)#1 (0) { } 'Closure$;1598121689$8f92529ae4ba8245e382e2b978bcf883$'Closure$;1598121689$8f92529ae4ba8245e382e2b978bcf883$ Object ( ) {}
Output for hhvm-3.10.0
object(Closure$;1598121689$a6f94c38d080f272815e7439185a24b$)#1 (0) { } 'Closure$;1598121689$a6f94c38d080f272815e7439185a24b$'Closure$;1598121689$a6f94c38d080f272815e7439185a24b$ Object ( ) {}
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/4v8hb on line 3
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/4v8hb on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/4v8hb on line 3
Process exited with code 255.