Description
Symfony version(s) affected: at least since 4.4.0
Description
When using Xdebug 3 with develop
mode disabled (i.e. for coverage in CI), a warning is triggered inside Symfony\Component\ErrorHandler\Error\FatalError
due to this like of code:
How to reproduce
- install Xdebug 3 and enable it WITHOUT
develop
mode - install the Error Handler and enable it
- throw an exception and do NOT catch it
Warning: Function must be enabled in php.ini by setting 'xdebug.mode' to 'develop'
Example of failure: https://github.com/getsentry/sentry-symfony/pull/475/checks?check_run_id=2247826488#step:9:25
So, function_exists
is no longer good enough for safeguarding such usage. Also, it seems that checking for xdebug.mode
from the ini is not good enough too: https://xdebug.org/docs/develop#mode
You can also set the mode by setting the
XDEBUG_MODE
environment variable on the command-line; this will take precedence over thexdebug.mode
setting, but will no change the value of thexdebug.mode
setting.