3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { try { try { throw new Exception('Foo'); } finally { throw new Exception('Bar', 0, null); } } catch (Exception $e) { throw new Exception('Zot', 0, $e); } } catch(Exception $exception) { $foo = $exception; while ($actualPrevious = $foo->getPrevious()) { $previous++; echo "Previous $previous\n"; var_dump($foo); } }

preferences:
36.6 ms | 402 KiB | 5 Q