Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fd9b2c9

Browse files
[ErrorHandler] fix throwing from __toString()
1 parent 801f4cd commit fd9b2c9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Debug/ErrorHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ public function handleError($type, $message, $file, $line)
401401
$scope = $this->scopedErrors & $type;
402402

403403
if (4 < $numArgs = \func_num_args()) {
404-
$context = $scope ? (func_get_arg(4) ?: []) : [];
404+
$context = func_get_arg(4) ?: [];
405405
$backtrace = 5 < $numArgs ? func_get_arg(5) : null; // defined on HHVM
406406
} else {
407407
$context = [];
@@ -453,7 +453,7 @@ public function handleError($type, $message, $file, $line)
453453
}
454454
} else {
455455
if ($scope) {
456-
$errorAsException = new ContextErrorException($logMessage, 0, $type, $file, $line, $context);
456+
$errorAsException = new ContextErrorException($logMessage, 0, $type, $file, $line, $scope ? $context : []);
457457
} else {
458458
$errorAsException = new \ErrorException($logMessage, 0, $type, $file, $line);
459459
}

0 commit comments

Comments
 (0)