#41445 [Csd]: parse_ini_file function has a problem with certain types of integer as sections
| From: | philip@php.net | Date: | Thu, 02 Aug 2007 14:33:55 +0000 |
| Subject: | #41445 [Csd]: parse_ini_file function has a problem with certain types of integer as sections | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-115682@lists.php.net to get a copy of this message | ||
ID: 41445
Updated by: philip@php.net
Reported By: dcox at conxxus dot com
Status: Closed
Bug Type: PHP options/info functions
Operating System: linux 2.4.32
PHP Version: 5.2.2
Assigned To: tony2001
New Comment:
FWIW, this bug also exists (and was documented) via:
http://bugs.php.net/bug.php?id=29306
The documentation will be updated to reflect the new fixed behaviour.
Previous Comments:
------------------------------------------------------------------------
[2007-06-26 12:10:11] tony2001@php.net
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.
------------------------------------------------------------------------
[2007-05-19 22:42:46] dcox at conxxus dot com
Description:
------------
I stumbled across this when storing MAC configuration in an INI file.
When the MAC address (length=12) had all numbers and started with "00"
then the MAC would not be stored as a section correctly.
Reproduce code:
---------------
<?php
$options = parse_ini_file("test.ini", TRUE);
print_r($options);
?>
-- test.ini --
[001099030277]
option1 = yes
[011099030277]
option2 = yes
Expected result:
----------------
Array
(
[001099030277] => Array
(
[option1] => 1
)
[011099030277] => Array
(
[option2] => 1
)
)
Actual result:
--------------
Array
(
[8] => Array
(
[option1] => 1
)
[011099030277] => Array
(
[option2] => 1
)
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41445&edit=1