Skip to content

Commit

Permalink
bug #40679 [Debug][ErrorHandler] Avoid warning with Xdebug 3 with dev…
Browse files Browse the repository at this point in the history
…elop mode disabled (Jean85)

This PR was merged into the 4.4 branch.

Discussion
----------

[Debug][ErrorHandler] Avoid warning with Xdebug 3 with develop mode disabled

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #40677
| License       | MIT

As reported in #40677, this fix is needed when Xdebug 3 is enabled but its `develop` mode is off.

Commits
-------

0e0639b Avoid warning with Xdebug 3 with develop mode disabled
  • Loading branch information
xabbuh committed Apr 6, 2021
2 parents 3b1948f + 0e0639b commit e357dbb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ public function __construct(string $message, int $code, int $severity, string $f

$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);
}
Expand Down
3 changes: 1 addition & 2 deletions src/Symfony/Component/ErrorHandler/Error/FatalError.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ public function __construct(string $message, int $code, array $error, int $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);
}
Expand Down

0 comments on commit e357dbb

Please sign in to comment.