3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function foo(array $bar) { $bar = new \Exception(); var_dump(func_get_args()); throw new \Exception(); } foo([], 132);
Output for 7.0.0 - 7.1.0
array(2) { [0]=> object(Exception)#1 (7) { ["message":protected]=> string(0) "" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/hv4FK" ["line":protected]=> int(3) ["trace":"Exception":private]=> array(1) { [0]=> array(4) { ["file"]=> string(9) "/in/hv4FK" ["line"]=> int(3) ["function"]=> string(3) "foo" ["args"]=> array(2) { [0]=> array(0) { } [1]=> int(132) } } } ["previous":"Exception":private]=> NULL } [1]=> int(132) } Fatal error: Uncaught Exception in /in/hv4FK:3 Stack trace: #0 /in/hv4FK(3): foo(Object(Exception), 132) #1 {main} thrown in /in/hv4FK on line 3
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
array(2) { [0]=> object(Exception)#1 (7) { ["message":protected]=> string(0) "" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/hv4FK" ["line":protected]=> int(3) ["trace":"Exception":private]=> array(1) { [0]=> array(4) { ["file"]=> string(9) "/in/hv4FK" ["line"]=> int(3) ["function"]=> string(3) "foo" ["args"]=> array(2) { [0]=> array(0) { } [1]=> int(132) } } } ["previous":"Exception":private]=> NULL } [1]=> int(132) } Fatal error: Uncaught exception 'Exception' with message '' in /in/hv4FK:3 Stack trace: #0 /in/hv4FK(3): foo() #1 {main}
Process exited with code 255.
Output for 5.4.0 - 5.6.28
array(2) { [0]=> array(0) { } [1]=> int(132) } Fatal error: Uncaught exception 'Exception' in /in/hv4FK:3 Stack trace: #0 /in/hv4FK(3): foo(Array, 132) #1 {main} thrown in /in/hv4FK on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/hv4FK on line 3
Process exited with code 255.
Output for 5.1.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/hv4FK on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/hv4FK on line 3 Parse error: syntax error, unexpected '[', expecting ')' in /in/hv4FK on line 3
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_ARRAY, expecting '&' or T_VARIABLE in /in/hv4FK on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_ARRAY, expecting ')' in /in/hv4FK on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_ARRAY, expecting ')' in /in/hv4FK on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/hv4FK on line 3
Process exited with code 255.