3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { (function() { return throw new Exception("first"); })(); } catch (Throwable $e) { var_dump($e); } try { (function() { throw new Exception("second"); })(); } catch (Throwable $e) { var_dump($e); } try { (function() { return throw throw throw new Exception("second"); })(); } catch (Throwable $e) { var_dump($e); }
Output for git.master, git.master_jit
object(Exception)#2 (7) { ["message":protected]=> string(5) "first" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/RqqZK" ["line":protected]=> int(3) ["trace":"Exception":private]=> array(1) { [0]=> array(4) { ["file"]=> string(9) "/in/RqqZK" ["line"]=> int(3) ["function"]=> string(21) "{closure:/in/RqqZK:3}" ["args"]=> array(0) { } } } ["previous":"Exception":private]=> NULL } object(Exception)#3 (7) { ["message":protected]=> string(6) "second" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/RqqZK" ["line":protected]=> int(5) ["trace":"Exception":private]=> array(1) { [0]=> array(4) { ["file"]=> string(9) "/in/RqqZK" ["line"]=> int(5) ["function"]=> string(21) "{closure:/in/RqqZK:5}" ["args"]=> array(0) { } } } ["previous":"Exception":private]=> NULL } object(Exception)#1 (7) { ["message":protected]=> string(6) "second" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/RqqZK" ["line":protected]=> int(7) ["trace":"Exception":private]=> array(1) { [0]=> array(4) { ["file"]=> string(9) "/in/RqqZK" ["line"]=> int(7) ["function"]=> string(21) "{closure:/in/RqqZK:7}" ["args"]=> array(0) { } } } ["previous":"Exception":private]=> NULL }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
47.95 ms | 410 KiB | 5 Q