Get your own PHP server Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<?php
try {
  try {
    throw new Exception("An error occurred", 1);
  } catch(Exception $e1) {
    throw new Exception("Another error occurred", 2, $e1);
  }
} catch (Exception $e2) {
  echo $previous = $e2->getPrevious();
  echo $previous->getMessage();
}
?>
</body>
</html>
Exception: An error occurred in /home/TwT0ln/prog.php:8
Stack trace:
#0 {main}An error occurred