From 0e0639b1294cd5e544ab2abcd54803ea10bd8ab0 Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Fri, 2 Apr 2021 09:50:12 +0200 Subject: [PATCH] Avoid warning with Xdebug 3 with develop mode disabled --- src/Symfony/Component/Debug/Exception/FatalErrorException.php | 3 +-- src/Symfony/Component/ErrorHandler/Error/FatalError.php | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Debug/Exception/FatalErrorException.php b/src/Symfony/Component/Debug/Exception/FatalErrorException.php index a9fd7bb9de..fbdad4c567 100644 --- a/src/Symfony/Component/Debug/Exception/FatalErrorException.php +++ b/src/Symfony/Component/Debug/Exception/FatalErrorException.php @@ -35,8 +35,7 @@ class FatalErrorException extends \ErrorException $this->setTrace($trace); } elseif (null !== $traceOffset) { - if (\function_exists('xdebug_get_function_stack')) { - $trace = xdebug_get_function_stack(); + if (\function_exists('xdebug_get_function_stack') && $trace = @xdebug_get_function_stack()) { if (0 < $traceOffset) { array_splice($trace, -$traceOffset); } diff --git a/src/Symfony/Component/ErrorHandler/Error/FatalError.php b/src/Symfony/Component/ErrorHandler/Error/FatalError.php index 98490b5acc..57fc690e26 100644 --- a/src/Symfony/Component/ErrorHandler/Error/FatalError.php +++ b/src/Symfony/Component/ErrorHandler/Error/FatalError.php @@ -33,8 +33,7 @@ class FatalError extends \Error } } } elseif (null !== $traceOffset) { - if (\function_exists('xdebug_get_function_stack')) { - $trace = xdebug_get_function_stack(); + if (\function_exists('xdebug_get_function_stack') && $trace = @xdebug_get_function_stack()) { if (0 < $traceOffset) { array_splice($trace, -$traceOffset); }