|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81166 "display_errors" php.ini is not normalized when set using ini_set
Submitted: 2021-06-18 09:02 UTC Modified: 2021-10-12 12:51 UTC
From: m at m dot cz Assigned:
Status: Open Package: PHP options/info functions
PHP Version: 8.0.7 OS: any
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2021-06-18 09:02 UTC] m at m dot cz
When "display_errors" php.ini option is set before startup (using php.ini ocnfig or "-d" cli option), it is normlaized to "" or "1" (or "stderr").

But when set using ini_set function, it is NOT normalized which makes checking the real value/effect from user script very hard.

Test script:
ini_set('display_errors', 'off');


Expected result:
string(0) ""

Actual result:
string(3) "off"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-06-21 15:31 UTC]
While this is somewhat inconsistent, there is some overall
consistency here.  On startup, the value is normalized by virtue
of the INI scanner (basically, the same what parse_ini_string()
does), while changes during runtime are processed normally for
string options.

While the behavior wrt. display_errors is not nice, it is worse
for other string options (e.g. error_prepend_string) where the
value `off` during startup is also treated as empty string.
 [2021-10-12 12:51 UTC]
Related to bug #52168.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 12 22:01:29 2024 UTC