3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php error_reporting(E_ALL | E_STRICT); header('Content-type: text/plain; charset=utf-8'); function a($a) { throw new Exception2('EXCEPTION MESSAGE'); } function b($b) { a($b); } try { b('THIS PARAMETER SHOULD SHOW UP'); } catch(Exception $e) { var_dump($e); } class Exception2 extends Exception { public function __construct() { $args = func_get_args(); call_user_func_array(array($this, 'parent::__construct'), $args); var_dump(debug_backtrace()); } }
Output for hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(3) { [0]=> array(7) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(7) ["function"]=> string(11) "__construct" ["class"]=> string(10) "Exception2" ["object"]=> object(Exception2)#1 (7) { ["message":protected]=> string(17) "EXCEPTION MESSAGE" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/QcHCP" ["line":protected]=> int(7) ["trace":"Exception":private]=> array(2) { [0]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(11) ["function"]=> string(1) "a" ["args"]=> array(1) { [0]=> string(29) "THIS PARAMETER SHOULD SHOW UP" } } [1]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(15) ["function"]=> string(1) "b" ["args"]=> array(1) { [0]=> string(29) "THIS PARAMETER SHOULD SHOW UP" } } } ["previous":"Exception":private]=> NULL } ["type"]=> string(2) "->" ["args"]=> array(1) { [0]=> string(17) "EXCEPTION MESSAGE" } } [1]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(11) ["function"]=> string(1) "a" ["args"]=> array(1) { [0]=> string(29) "THIS PARAMETER SHOULD SHOW UP" } } [2]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(15) ["function"]=> string(1) "b" ["args"]=> array(1) { [0]=> string(29) "THIS PARAMETER SHOULD SHOW UP" } } } object(Exception2)#1 (7) { ["message":protected]=> string(17) "EXCEPTION MESSAGE" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/QcHCP" ["line":protected]=> int(7) ["trace":"Exception":private]=> array(2) { [0]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(11) ["function"]=> string(1) "a" ["args"]=> array(1) { [0]=> string(29) "THIS PARAMETER SHOULD SHOW UP" } } [1]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(15) ["function"]=> string(1) "b" ["args"]=> array(1) { [0]=> string(29) "THIS PARAMETER SHOULD SHOW UP" } } } ["previous":"Exception":private]=> NULL }
Output for 5.3.0 - 5.6.28
array(3) { [0]=> array(7) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(7) ["function"]=> string(11) "__construct" ["class"]=> string(10) "Exception2" ["object"]=> object(Exception2)#1 (7) { ["message":protected]=> string(17) "EXCEPTION MESSAGE" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/QcHCP" ["line":protected]=> int(7) ["trace":"Exception":private]=> array(2) { [0]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(11) ["function"]=> string(1) "a" ["args"]=> array(1) { [0]=> &string(29) "THIS PARAMETER SHOULD SHOW UP" } } [1]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(15) ["function"]=> string(1) "b" ["args"]=> array(1) { [0]=> &string(29) "THIS PARAMETER SHOULD SHOW UP" } } } ["previous":"Exception":private]=> NULL } ["type"]=> string(2) "->" ["args"]=> array(1) { [0]=> &string(17) "EXCEPTION MESSAGE" } } [1]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(11) ["function"]=> string(1) "a" ["args"]=> array(1) { [0]=> &string(29) "THIS PARAMETER SHOULD SHOW UP" } } [2]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(15) ["function"]=> string(1) "b" ["args"]=> array(1) { [0]=> &string(29) "THIS PARAMETER SHOULD SHOW UP" } } } object(Exception2)#1 (7) { ["message":protected]=> string(17) "EXCEPTION MESSAGE" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/QcHCP" ["line":protected]=> int(7) ["trace":"Exception":private]=> array(2) { [0]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(11) ["function"]=> string(1) "a" ["args"]=> array(1) { [0]=> string(29) "THIS PARAMETER SHOULD SHOW UP" } } [1]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(15) ["function"]=> string(1) "b" ["args"]=> array(1) { [0]=> string(29) "THIS PARAMETER SHOULD SHOW UP" } } } ["previous":"Exception":private]=> NULL }
Output for 5.1.2 - 5.2.17
array(3) { [0]=> array(7) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(7) ["function"]=> string(11) "__construct" ["class"]=> string(10) "Exception2" ["object"]=> object(Exception2)#1 (6) { ["message:protected"]=> string(17) "EXCEPTION MESSAGE" ["string:private"]=> string(0) "" ["code:protected"]=> int(0) ["file:protected"]=> string(9) "/in/QcHCP" ["line:protected"]=> int(7) ["trace:private"]=> array(2) { [0]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(11) ["function"]=> string(1) "a" ["args"]=> array(1) { [0]=> &string(29) "THIS PARAMETER SHOULD SHOW UP" } } [1]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(15) ["function"]=> string(1) "b" ["args"]=> array(1) { [0]=> &string(29) "THIS PARAMETER SHOULD SHOW UP" } } } } ["type"]=> string(2) "->" ["args"]=> array(1) { [0]=> &string(17) "EXCEPTION MESSAGE" } } [1]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(11) ["function"]=> string(1) "a" ["args"]=> array(1) { [0]=> &string(29) "THIS PARAMETER SHOULD SHOW UP" } } [2]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(15) ["function"]=> string(1) "b" ["args"]=> array(1) { [0]=> &string(29) "THIS PARAMETER SHOULD SHOW UP" } } } object(Exception2)#1 (6) { ["message:protected"]=> string(17) "EXCEPTION MESSAGE" ["string:private"]=> string(0) "" ["code:protected"]=> int(0) ["file:protected"]=> string(9) "/in/QcHCP" ["line:protected"]=> int(7) ["trace:private"]=> array(2) { [0]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(11) ["function"]=> string(1) "a" ["args"]=> array(1) { [0]=> string(29) "THIS PARAMETER SHOULD SHOW UP" } } [1]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(15) ["function"]=> string(1) "b" ["args"]=> array(1) { [0]=> string(29) "THIS PARAMETER SHOULD SHOW UP" } } } }
Output for 5.1.1
Warning: call_user_func_array(): First argument is expected to be a valid callback, 'Exception2::parent::__construct' was given in /in/QcHCP on line 26 array(3) { [0]=> array(7) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(7) ["function"]=> string(11) "__construct" ["class"]=> string(10) "Exception2" ["object"]=> object(Exception2)#1 (6) { ["message:protected"]=> string(0) "" ["string:private"]=> string(0) "" ["code:protected"]=> int(0) ["file:protected"]=> string(9) "/in/QcHCP" ["line:protected"]=> int(7) ["trace:private"]=> array(2) { [0]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(11) ["function"]=> string(1) "a" ["args"]=> array(1) { [0]=> &string(29) "THIS PARAMETER SHOULD SHOW UP" } } [1]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(15) ["function"]=> string(1) "b" ["args"]=> array(1) { [0]=> &string(29) "THIS PARAMETER SHOULD SHOW UP" } } } } ["type"]=> string(2) "->" ["args"]=> array(1) { [0]=> &string(17) "EXCEPTION MESSAGE" } } [1]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(11) ["function"]=> string(1) "a" ["args"]=> array(1) { [0]=> &string(29) "THIS PARAMETER SHOULD SHOW UP" } } [2]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(15) ["function"]=> string(1) "b" ["args"]=> array(1) { [0]=> &string(29) "THIS PARAMETER SHOULD SHOW UP" } } } object(Exception2)#1 (6) { ["message:protected"]=> string(0) "" ["string:private"]=> string(0) "" ["code:protected"]=> int(0) ["file:protected"]=> string(9) "/in/QcHCP" ["line:protected"]=> int(7) ["trace:private"]=> array(2) { [0]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(11) ["function"]=> string(1) "a" ["args"]=> array(1) { [0]=> string(29) "THIS PARAMETER SHOULD SHOW UP" } } [1]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(15) ["function"]=> string(1) "b" ["args"]=> array(1) { [0]=> string(29) "THIS PARAMETER SHOULD SHOW UP" } } } }
Output for 5.0.0 - 5.0.2, 5.0.5 - 5.1.0
Warning: call_user_func_array(): First argument is expected to be a valid callback, 'Exception2::parent::__construct' was given in /in/QcHCP on line 26 array(3) { [0]=> array(6) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(7) ["function"]=> string(11) "__construct" ["class"]=> string(10) "Exception2" ["type"]=> string(2) "->" ["args"]=> array(1) { [0]=> &string(17) "EXCEPTION MESSAGE" } } [1]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(11) ["function"]=> string(1) "a" ["args"]=> array(1) { [0]=> &string(29) "THIS PARAMETER SHOULD SHOW UP" } } [2]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(15) ["function"]=> string(1) "b" ["args"]=> array(1) { [0]=> &string(29) "THIS PARAMETER SHOULD SHOW UP" } } } object(Exception2)#1 (6) { ["message:protected"]=> string(0) "" ["string:private"]=> string(0) "" ["code:protected"]=> int(0) ["file:protected"]=> string(9) "/in/QcHCP" ["line:protected"]=> int(7) ["trace:private"]=> array(2) { [0]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(11) ["function"]=> string(1) "a" ["args"]=> array(1) { [0]=> string(29) "THIS PARAMETER SHOULD SHOW UP" } } [1]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(15) ["function"]=> string(1) "b" ["args"]=> array(1) { [0]=> string(29) "THIS PARAMETER SHOULD SHOW UP" } } } }
Output for 5.0.3 - 5.0.4
Warning: call_user_func_array(): First argument is expected to be a valid callback, 'Exception2::parent::__construct' was given in /in/QcHCP on line 26 array(3) { [0]=> array(6) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(7) ["function"]=> string(11) "__construct" ["class"]=> string(10) "Exception2" ["type"]=> string(2) "->" ["args"]=> array(1) { [0]=> &string(17) "EXCEPTION MESSAGE" } } [1]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(11) ["function"]=> string(1) "a" ["args"]=> array(1) { [0]=> &string(29) "THIS PARAMETER SHOULD SHOW UP" } } [2]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(15) ["function"]=> string(1) "b" ["args"]=> array(1) { [0]=> &string(29) "THIS PARAMETER SHOULD SHOW UP" } } } object(Exception2)#1 (6) { ["message:protected"]=> string(0) "" ["string:private"]=> string(0) "" ["code:protected"]=> int(0) ["file:protected"]=> string(9) "/in/QcHCP" ["line:protected"]=> int(7) ["trace:private"]=> array(3) { [0]=> array(3) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(7) ["function"]=> string(1) "a" } [1]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(11) ["function"]=> string(1) "a" ["args"]=> array(1) { [0]=> string(29) "THIS PARAMETER SHOULD SHOW UP" } } [2]=> array(4) { ["file"]=> string(9) "/in/QcHCP" ["line"]=> int(15) ["function"]=> string(1) "b" ["args"]=> array(1) { [0]=> string(29) "THIS PARAMETER SHOULD SHOW UP" } } } }
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_NEW in /in/QcHCP on line 7
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/QcHCP on line 7
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/QcHCP on line 7
Process exited with code 255.