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

Skip to content

Commit 74ee29d

Browse files
committed
bug #21401 [Debug] Workaround "null" $context (nicolas-grekas)
This PR was merged into the 2.7 branch. Discussion ---------- [Debug] Workaround "null" $context | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - As reported in #20068, the imap extension can call error handlers with $context = null. Commits ------- 2555f31 [Debug] Workaround "null" $context
2 parents dd4e78c + 2555f31 commit 74ee29d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Debug/ErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ public function handleError($type, $message, $file, $line)
373373
$scope = $this->scopedErrors & $type;
374374

375375
if (4 < $numArgs = func_num_args()) {
376-
$context = $scope ? func_get_arg(4) : array();
376+
$context = $scope ? (func_get_arg(4) ?: array()) : array();
377377
$backtrace = 5 < $numArgs ? func_get_arg(5) : null; // defined on HHVM
378378
} else {
379379
$context = array();

0 commit comments

Comments
 (0)