#41445 [Asn->Csd]: parse_ini_file function has a problem with certain types of integer as sections

From: Date: Tue, 26 Jun 2007 12:10:12 +0000
Subject: #41445 [Asn->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-114272@lists.php.net to get a copy of this message
ID: 41445 Updated by: tony2001@php.net Reported By: dcox at conxxus dot com -Status: Assigned +Status: Closed Bug Type: PHP options/info functions Operating System: linux 2.4.32 PHP Version: 5.2.2 Assigned To: tony2001 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-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

« previous php.bugs (#114272) next »