3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function f($b) { if ($b) throw new Exception("e"); } function g($b) { try { f($b); } catch (Exception $e) { } var_dump($e); } g(false); g(true);
Output for 7.0.0 - 7.1.0
Notice: Undefined variable: e in /in/tFsFi on line 17 NULL object(Exception)#1 (7) { ["message":protected]=> string(1) "e" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/tFsFi" ["line":protected]=> int(5) ["trace":"Exception":private]=> array(2) { [0]=> array(4) { ["file"]=> string(9) "/in/tFsFi" ["line"]=> int(12) ["function"]=> string(1) "f" ["args"]=> array(1) { [0]=> bool(true) } } [1]=> array(4) { ["file"]=> string(9) "/in/tFsFi" ["line"]=> int(21) ["function"]=> string(1) "g" ["args"]=> array(1) { [0]=> bool(true) } } } ["previous":"Exception":private]=> NULL }
Output for 5.3.0 - 5.6.28
Notice: Undefined variable: e in /in/tFsFi on line 17 NULL object(Exception)#1 (7) { ["message":protected]=> string(1) "e" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/tFsFi" ["line":protected]=> int(5) ["trace":"Exception":private]=> array(2) { [0]=> array(4) { ["file"]=> string(9) "/in/tFsFi" ["line"]=> int(12) ["function"]=> string(1) "f" ["args"]=> array(1) { [0]=> bool(true) } } [1]=> array(4) { ["file"]=> string(9) "/in/tFsFi" ["line"]=> int(21) ["function"]=> string(1) "g" ["args"]=> array(1) { [0]=> &bool(true) } } } ["previous":"Exception":private]=> NULL }
Output for 5.0.5 - 5.2.17
Notice: Undefined variable: e in /in/tFsFi on line 17 NULL object(Exception)#1 (6) { ["message:protected"]=> string(1) "e" ["string:private"]=> string(0) "" ["code:protected"]=> int(0) ["file:protected"]=> string(9) "/in/tFsFi" ["line:protected"]=> int(5) ["trace:private"]=> array(2) { [0]=> array(4) { ["file"]=> string(9) "/in/tFsFi" ["line"]=> int(12) ["function"]=> string(1) "f" ["args"]=> array(1) { [0]=> bool(true) } } [1]=> array(4) { ["file"]=> string(9) "/in/tFsFi" ["line"]=> int(21) ["function"]=> string(1) "g" ["args"]=> array(1) { [0]=> &bool(true) } } } }
Output for 5.0.4
Notice: Undefined variable: e in /in/tFsFi on line 17 NULL object(Exception)#1 (6) { ["message:protected"]=> string(1) "e" ["string:private"]=> string(0) "" ["code:protected"]=> int(0) ["file:protected"]=> string(9) "/in/tFsFi" ["line:protected"]=> int(5) ["trace:private"]=> array(3) { [0]=> array(3) { ["file"]=> string(9) "/in/tFsFi" ["line"]=> int(5) ["function"]=> string(1) "f" } [1]=> array(4) { ["file"]=> string(9) "/in/tFsFi" ["line"]=> int(12) ["function"]=> string(1) "f" ["args"]=> array(1) { [0]=> bool(true) } } [2]=> array(4) { ["file"]=> string(9) "/in/tFsFi" ["line"]=> int(21) ["function"]=> string(1) "g" ["args"]=> array(1) { [0]=> &bool(true) } } } }
Output for 5.0.3
Notice: Undefined variable: e in /in/tFsFi on line 17 NULL object(Exception)#1 (6) { ["message:protected"]=> string(1) "e" ["string:private"]=> string(0) "" ["code:protected"]=> int(0) ["file:protected"]=> string(9) "/in/tFsFi" ["line:protected"]=> int(5) ["trace:private"]=> array(3) { [0]=> array(3) { ["file"]=> string(9) "/in/tFsFi" ["line"]=> int(5) ["function"]=> string(1) "f" } [1]=> array(4) { ["file"]=> string(9) "/in/tFsFi" ["line"]=> int(12) ["function"]=> string(1) "f" ["args"]=> array(1) { [0]=> bool(true) } } [2]=> array(4) { ["file"]=> string(9) "/in/tFsFi" ["line"]=> int(21) ["function"]=> string(1) "g" ["args"]=> array(1) { [0]=> &bool(true) } } } }
Output for 5.0.0 - 5.0.2
Notice: Undefined variable: e in /in/tFsFi on line 17 NULL object(Exception)#1 (6) { ["message:protected"]=> string(1) "e" ["string:private"]=> string(0) "" ["code:protected"]=> int(0) ["file:protected"]=> string(9) "/in/tFsFi" ["line:protected"]=> int(5) ["trace:private"]=> array(2) { [0]=> array(4) { ["file"]=> string(9) "/in/tFsFi" ["line"]=> int(12) ["function"]=> string(1) "f" ["args"]=> array(1) { [0]=> bool(true) } } [1]=> array(4) { ["file"]=> string(9) "/in/tFsFi" ["line"]=> int(21) ["function"]=> string(1) "g" ["args"]=> array(1) { [0]=> &bool(true) } } } }
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_NEW in /in/tFsFi on line 5
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_NEW in /in/tFsFi on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/tFsFi on line 5
Process exited with code 255.