|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42071 parse_ini_file() doesn?t give expected output with NO & NULL (reserved)keywords
Submitted: 2007-07-22 17:23 UTC Modified: 2007-07-23 16:17 UTC
From: mahesh dot vemula at in dot ibm dot com Assigned: jani (profile)
Status: Closed Package: PHP options/info functions
PHP Version: 5CVS-2007-07-22 (CVS) OS: RHEL 4, Windows Xp
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: mahesh dot vemula at in dot ibm dot com
New email:
PHP Version: OS:


 [2007-07-22 17:23 UTC] mahesh dot vemula at in dot ibm dot com
PHP engine doesn?t throw the expected parsing error (which is according to doc, ? with the reserved keywords, NO and NULL given as keys in the .ini file. 
For the remaining reserved keywords php throws parsing error which is expected according to doc.

Operating System: Linux, Windows XP
PHP Version:PHP 5.2.4-dev (cli) (built: Jul 21 2007 19:21:35)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
Configure Setup: ./configure

Reproduce code:
$ini_array = parse_ini_file(dirname(__FILE__)."/parse.ini");

;start of ini file

;YES = "correct"
;expected parsing error
N0 = "wrong"
NULL = "wrong"

;end of ini file

Expected result:
PHP Warning:  Error parsing %s/parse.ini on line %d in %s\parse_ini_file.php on line %d

Actual result:
    [N0] => wrong
    [NULL] => wrong


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-07-23 15:51 UTC]
Note: You have a little error in your example script.
N0 is not reserved. (0 == zero!)
If you replace that with 'no' or 'NO' it will error out like it should.

But 'null' is indeed allowed. I'll fix it soonish.

 [2007-07-23 16:17 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 14 08:01:29 2024 UTC