Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the point of this message is, that php processes may slow down because xdebug beeing loaded.
phpstan doesn't get slowser because of
--xdebugUh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't xdebug handler prevent that by disabling the extension?
My understanding of --xdebug is that it prevents xdebug handler from doing so.
The current phrasing makes it sound like --xdebug will improve performance which I don't think is the case either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When xdebug is loaded things get a lot slower - e.g. when running
make tests.If you don't run with
--xdebugyou get a slow process without any benefits - hence the warning.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole point of
XdebugHandleris to restart the process without Xdebug exactly to avoid this slow down, even if it is installed. By testing forXdebugHandler::isXdebugActive()before$xdebug->check();this message is being shown when it's not relevant.Here are some numbers from a fairly large project.
php phpstan: 117 sec
php+xdebug phpstan: 110 sec
php+xdebug phpstan --xdebug: 264 sec
Maybe you had
PHPSTAN_ALLOW_XDEBUG=1set in your enviroment when testing this so that Xdebug was left active? This would cause Xdebug to still be loaded and result in the behavior you describe (https://github.com/composer/xdebug-handler#basic-usage).Edit: see #2299 for a fix for that issue.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the confusing nature of the message has been pointed out by others as well: #1878 (comment), issue/WI-69996
How about this phrasing instead?
I took out
and the process will not halt at breakpointsto keep the message relatively short as users are unlikely to have set any breakpoints if they where unaware that Xdebug is loaded.If neither of these versions seem suitable, could you please help me rephrase it? It sounds like the message might be related to how
make testsworks internally, something I'm not familiar with.The warning is causing confusion for end-users in its current form. I have noticed that some people are setting up their CI to run slower due to misunderstanding the message and thinking that using --xdebug will actually improve performance when Xdebug is active. Your help with resolving this issue would be greatly appreciated. Thank you