<html>
<body>
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>
<!-- Mirrored from www.w3schools.com/php/phptryit.asp?filename=tryphp_exception_getprevious by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 17:22:39 GMT -->
</html>