3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $e = new Exception('lol'); $e2 = new Exception($e); var_dump($e2->getMessage());
based on ksiGD
Output for 7.0.0 - 7.2.11
string(52) "Exception: lol in /in/L2iON:3 Stack trace: #0 {main}"
Output for hhvm-3.22.0
object(Exception)#1 (7) { ["message":protected]=> string(3) "lol" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/L2iON" ["line":protected]=> int(-1) ["trace":"Exception":private]=> array(0) { } ["previous":"Exception":private]=> NULL }
Output for hhvm-3.15.4 - 3.21.3
object(Exception)#1 (7) { ["message":protected]=> string(3) "lol" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/L2iON" ["line":protected]=> int(3) ["trace":"Exception":private]=> array(0) { } ["previous":"Exception":private]=> NULL }
Output for 5.6.0 - 5.6.38
string(78) "exception 'Exception' with message 'lol' in /in/L2iON:3 Stack trace: #0 {main}"