Skip to content

[HttpKernel] Only remove E_WARNING from error level during kernel init #59975

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

fritzmg
Copy link
Contributor

@fritzmg fritzmg commented Mar 14, 2025

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #59139
License MIT

This fixes #59139 as mentioned in #59139 (comment).

With PHP 8.4 there can currently be a huge console output spam showing the

Implicitly marking parameter as nullable is deprecated, the explicit nullable type must be used instead

deprecation, depending on your installed packages. This is caused by the kernel completely overriding the PHP error level within initializeContainer(), which will cause everything to be shown (except warnings) that is triggered during include.

The kernel should always adhere to the error_reporting level set by the environment - thus this PR fixes this issue by only removing the E_WARNING level from the error_reporting level when trying to silence the include failures while including the cache path during kernel init.

@carsonbot

This comment was marked as resolved.

@fritzmg fritzmg changed the base branch from 7.3 to 6.4 March 14, 2025 13:54
@alexandre-daubois alexandre-daubois modified the milestones: 7.3, 6.4 Mar 14, 2025
@carsonbot carsonbot changed the title Only remove E_WARNING from error level during kernel init [HttpKernel] Only remove E_WARNING from error level during kernel init Mar 14, 2025
@nicolas-grekas
Copy link
Member

Thank you @fritzmg.

@nicolas-grekas nicolas-grekas merged commit 627f373 into symfony:6.4 Mar 19, 2025
11 checks passed
@fritzmg fritzmg deleted the bugfix/only-silence-ewarning-additionally branch March 19, 2025 17:11
This was referenced Mar 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bin/console always outputs 'Deprecated:' notices to console; ignores env/flags/config to turn it off.
4 participants