Skip to content

Commit c03b356

Browse files
Merge branch '3.4' into 4.4
* 3.4: [ErrorHandler] fix throwing from __toString() Removed comments and requirements relative to php <5.5 (not supported anymore) fix validating lazy properties that evaluate to null
1 parent 0df9a23 commit c03b356

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

ErrorHandler.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -423,18 +423,6 @@ public function handleError(int $type, string $message, string $file, int $line)
423423
}
424424
$scope = $this->scopedErrors & $type;
425425

426-
if (4 < $numArgs = \func_num_args()) {
427-
$context = $scope ? (func_get_arg(4) ?: []) : [];
428-
} else {
429-
$context = [];
430-
}
431-
432-
if (isset($context['GLOBALS']) && $scope) {
433-
$e = $context; // Whatever the signature of the method,
434-
unset($e['GLOBALS'], $context); // $context is always a reference in 5.3
435-
$context = $e;
436-
}
437-
438426
if (false !== strpos($message, "@anonymous\0")) {
439427
$logMessage = $this->parseAnonymousClass($message);
440428
} else {
@@ -496,6 +484,8 @@ public function handleError(int $type, string $message, string $file, int $line)
496484
// `return trigger_error($e, E_USER_ERROR);` allows this error handler
497485
// to make $e get through the __toString() barrier.
498486

487+
$context = 4 < \func_num_args() ? (func_get_arg(4) ?: []) : [];
488+
499489
foreach ($context as $e) {
500490
if ($e instanceof \Throwable && $e->__toString() === $message) {
501491
self::$toStringException = $e;

0 commit comments

Comments
 (0)