3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function a() { return new Exception(); } function b() { $ex = a(); throw $ex; } $ex = a(); echo (string)$ex; echo PHP_EOL . PHP_EOL . PHP_EOL; try { b(); } catch (Exception $ex) { echo (string)$ex; }
based on BADjp
Output for 7.0.0 - 7.2.0
Exception in /in/SBA4g:4 Stack trace: #0 /in/SBA4g(12): a() #1 {main} Exception in /in/SBA4g:4 Stack trace: #0 /in/SBA4g(8): a() #1 /in/SBA4g(18): b() #2 {main}
Output for 5.3.19 - 5.6.28
exception 'Exception' in /in/SBA4g:4 Stack trace: #0 /in/SBA4g(12): a() #1 {main} exception 'Exception' in /in/SBA4g:4 Stack trace: #0 /in/SBA4g(8): a() #1 /in/SBA4g(18): b() #2 {main}