diff --git a/src/Symfony/Component/ErrorHandler/Error/FatalError.php b/src/Symfony/Component/ErrorHandler/Error/FatalError.php index 57fc690e26d6c..5a96a94ad1959 100644 --- a/src/Symfony/Component/ErrorHandler/Error/FatalError.php +++ b/src/Symfony/Component/ErrorHandler/Error/FatalError.php @@ -33,7 +33,9 @@ public function __construct(string $message, int $code, array $error, int $trace } } } elseif (null !== $traceOffset) { - if (\function_exists('xdebug_get_function_stack') && $trace = @xdebug_get_function_stack()) { + // xdebug >= 3.0 has an ini xdebug.mode (not present in v2) that must be set to 'develop' for xdebug_get_function_stack() + if (\function_exists('xdebug_get_function_stack') && \in_array(ini_get('xdebug.mode'), ['develop', false], true)) { + $trace = xdebug_get_function_stack(); if (0 < $traceOffset) { array_splice($trace, -$traceOffset); }