<?php function three() { throw new RuntimeException('first exception'); } function two() { try { three(); } catch (Throwable $e) { throw new CustomException('custom', previous: $e); } } function one() { two(); } class CustomException extends Exception { public function getFullTrace() { return $this->getPrevious()?->getTrace() ?? $this->getTrace(); } } try { one(); } catch (CustomException $e) { var_dump($e->getFullTrace()); }
You have javascript disabled. You will not be able to edit any code.