Skip to content

Commit d618a99

Browse files
bug #39196 [DI] Fix Xdebug 3.0 detection (vertexvaar)
This PR was squashed before being merged into the 4.4 branch. Discussion ---------- [DI] Fix Xdebug 3.0 detection | Q | A | ------------- | --- | Branch? | 4.4 (for bug fixes) | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #39195 | License | MIT | Doc PR | n/a Xdebug 3.0 removed the function `xdebug_is_enabled()`. To detect if Xdebug 3.0 is installed (it doesn't even need to be enabled to reproduce the bug) i added `function_exists('xdebug_info')`. AFAIS `xdebug_info()` is available in Xdebug >= 3.0 only. Commits ------- 38f8edddb1 [DI] Fix Xdebug 3.0 detection
2 parents 253f992 + ceb9cce commit d618a99

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Exception/AutowiringFailedException.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ public function __construct(string $serviceId, $message = '', int $code = 0, \Th
2323
{
2424
$this->serviceId = $serviceId;
2525

26-
if ($message instanceof \Closure && \function_exists('xdebug_is_enabled') && xdebug_is_enabled()) {
26+
if (
27+
$message instanceof \Closure
28+
&& (\function_exists('xdebug_is_enabled') ? xdebug_is_enabled() : \function_exists('xdebug_info'))
29+
) {
2730
$message = $message();
2831
}
2932

0 commit comments

Comments
 (0)