3v4l.org

run code in 300+ PHP versions simultaneously
<?php class T { function __toString(){ echo "before"; throw new Exception; } } $t = new T; try { echo substr($t, 0, 0); echo " after"; } catch (Exception $e) { echo "caught"; }

preferences:
32.29 ms | 402 KiB | 5 Q