3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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); } }
based on I6Qcf