|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55648 CLI: the ini directives passed with -d to the CLI do not parse constants.
Submitted: 2011-09-08 18:49 UTC Modified: 2016-07-10 04:22 UTC
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: Assigned: cmb (profile)
Status: No Feedback Package: CGI/CLI related
PHP Version: 5.4SVN-2011-09-06 (snap) OS: Windows 7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2011-09-08 18:49 UTC]
In posix-based systems, you can set error_reporting from the command line using 
the constants, but on Windows this always fails and results in an 
error_reporting() value of zero. 

This affects test automation, where these directives may be supplied in the INI 
section of a phpt test case. run-tests.php runs these tests by passing their ini-
directives as -d. While run-tests.php explicitly sets the numeric value of these 
constants in the base ini, they do not get explicitly set in phpt-specific 
overrides. Thus, output may be different than expected.

Test script:
php.exe -n -d "error_reporting=E_ALL" -r "var_dump(error_reporting());"

Expected result:

# or similar

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-09-15 15:02 UTC]
Cannot reproduce on 5.4.0 Beta 1 on Windows 7:

C:\php-5.4.0beta1>php.exe -d "error_reporting=E_ALL" -r "var_dump(error_reportin

C:\php-5.4.0beta1>php.exe -d "error_reporting=E_ALL&~E_NOTICE" -r "var_dump(erro

Output stays same if I add -n option.
 [2016-06-29 12:46 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2016-06-29 12:46 UTC]
I also can't reproduce with PHP 5.4.19 on Windows 10. Apparently,
this issue has been resolved, so please try with a recent version,
 [2016-07-10 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Feb 21 09:01:28 2024 UTC