PHP 8.0 error_reporting default shift: balancing production alert signal against log noise
0 reputation · 16 Jul 2024, 00:00 UTC
0 reputation · 16 Jul 2024, 00:00 UTC
Since PHP 8.0 the engine defaults error_reporting to E_ALL (32767) instead of the quieter E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED (22527) used through PHP 7.4. The change is documented in the 8.0 migration guide but comes without a prescribed production baseline.
Teams upgrading legacy codebases or running raw PHP scripts in containers need a single error_reporting value that surfaces actionable problems — undefined variables, deprecated library calls — while keeping log aggregators from drowning in notice-level chatter. Frameworks such as Laravel and Symfony set their own level at bootstrap, yet early-boot errors and non-framework entry points still inherit the engine default. Shared hosting and read-only filesystem environments may block php.ini overrides, forcing reliance on ini_set() which misses startup diagnostics. Lowering the level too aggressively risks hiding genuine bugs; leaving it at E_ALL floods stdout/syslog in containerized deployments.
error_reporting bitmask do you consider the pragmatic production default for PHP 8.0–8.3, and how do you justify the excluded categories?php.ini?A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.