3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php try { try { echo 'try'; throw new \Exception('1'); } catch (\Exception $e) { echo 'catch'; throw new \Exception('2'); } finally { echo 'finally'; throw new \Exception('3'); } } catch (\Exception $e) { var_dump($e); } echo 'lolo';
based on d9F6F
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.21.3, 7.0.0 - 7.3.0beta1
trycatchfinallyobject(Exception)#3 (7) { ["message":protected]=> string(1) "3" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(10) "/in/HlPPjo" ["line":protected]=> int(11) ["trace":"Exception":private]=> array(0) { } ["previous":"Exception":private]=> object(Exception)#2 (7) { ["message":protected]=> string(1) "2" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(10) "/in/HlPPjo" ["line":protected]=> int(8) ["trace":"Exception":private]=> array(0) { } ["previous":"Exception":private]=> NULL } } lolo
Output for hhvm-3.22.0
trycatchfinallyobject(Exception)#3 (7) { ["message":protected]=> string(1) "3" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(10) "/in/HlPPjo" ["line":protected]=> int(-1) ["trace":"Exception":private]=> array(0) { } ["previous":"Exception":private]=> object(Exception)#2 (7) { ["message":protected]=> string(1) "2" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(10) "/in/HlPPjo" ["line":protected]=> int(-1) ["trace":"Exception":private]=> array(0) { } ["previous":"Exception":private]=> NULL } } lolo