3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $exception = new \RuntimeException('test'); var_dump((string) $exception); var_dump(new $exception);
Output for 7.0.28 - 7.3.0rc3
string(60) "RuntimeException: test in /in/riJJm:3 Stack trace: #0 {main}" object(RuntimeException)#2 (7) { ["message":protected]=> string(0) "" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/riJJm" ["line":protected]=> int(7) ["trace":"Exception":private]=> array(0) { } ["previous":"Exception":private]=> NULL }
Output for 5.6.38
string(86) "exception 'RuntimeException' with message 'test' in /in/riJJm:3 Stack trace: #0 {main}" object(RuntimeException)#2 (7) { ["message":protected]=> string(0) "" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/riJJm" ["line":protected]=> int(7) ["trace":"Exception":private]=> array(0) { } ["previous":"Exception":private]=> NULL }