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

From: Date: Tue, 29 May 2007 20:49:08 +0000
Subject: #41445 [Opn->Asn]: 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-113169@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: Open +Status: Assigned Bug Type: PHP options/info functions Operating System: linux 2.4.32 PHP Version: 5.2.2 -Assigned To: +Assigned To: tony2001 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 (#113169) next »