diff --git a/src/Symfony/Component/Debug/ErrorHandler.php b/src/Symfony/Component/Debug/ErrorHandler.php index 2436a1f249cc..038b8b6a3d4c 100644 --- a/src/Symfony/Component/Debug/ErrorHandler.php +++ b/src/Symfony/Component/Debug/ErrorHandler.php @@ -126,6 +126,10 @@ function ($row) { require __DIR__.'/Exception/ContextErrorException.php'; } + if (PHP_VERSION_ID < 50400 && isset($context['GLOBALS'])) { + unset($context['GLOBALS']); + } + $exception = new ContextErrorException(sprintf('%s: %s in %s line %d', isset($this->levels[$level]) ? $this->levels[$level] : $level, $message, $file, $line), 0, $level, $file, $line, $context); // Exceptions thrown from error handlers are sometimes not caught by the exception