<!DOCTYPE html>
<html>
<body>
<?php
function myFunction($num) {
throw new Exception("发生了一个错误");
}
try {
myFunction(5);
} catch (Exception $e) {
print_r($e->getTrace());
?>
</body>
</html>