#42071 [Asn->Csd]: parse_ini_file() doesnt give expected output with NO & NULL (reserved)keywords
| From: | jani@php.net | Date: | Mon, 23 Jul 2007 16:17:28 +0000 |
| Subject: | #42071 [Asn->Csd]: parse_ini_file() doesnt give expected output with NO & NULL (reserved)keywords | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-115355@lists.php.net to get a copy of this message | ||
ID: 42071
Updated by: jani@php.net
Reported By: mahesh dot vemula at in dot ibm dot com
-Status: Assigned
+Status: Closed
Bug Type: PHP options/info functions
Operating System: RHEL 4, Windows Xp
PHP Version: 5CVS-2007-07-22 (CVS)
Assigned To: jani
New Comment:
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
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2007-07-23 15:51:28] jani@php.net
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-22 17:23:23] mahesh dot vemula at in dot ibm dot com
Description:
------------
PHP engine doesnt throw the expected parsing error (which is according
to doc, http://in2.php.net/manual/en/function.parse-ini-file.php.)
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.
Environment:
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:
---------------
Parse_ini_file.php:
<?php
$ini_array = parse_ini_file(dirname(__FILE__)."/parse.ini");
print_r($ini_array);
?>
parse.ini:
;start of ini file
[ReservedKeys_as_Keys]
;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
Array
(
)
Actual result:
--------------
Array
(
[N0] => wrong
[NULL] => wrong
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42071&edit=1