Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.10.12

Bug #10010 numeric index lost when parsing subarrays
Submitted: 2007-02-02 11:33 UTC
From: werner at seagullproject dot org Assigned: aashley
Status: Closed Package: Config (version 1.10.9)
PHP Version: 5.1.2 OS: linux
Roadmaps: 1.10.10    
Subscription  


 [2007-02-02 11:33 UTC] werner at seagullproject dot org (Werner Krauss)
Description: ------------ we have an array with subarrays (e.g. list of month names) that should be saved as a phparray file. the numeric indexes of the month names get lost when parsing the array, instead the array begins with index 0. Maybe the changes from http://pear.php.net/bugs/bug.php?id=3590 caused this behaviour? Commenting out the "is_numeric" clause gives me the expected result. Test script: --------------- $aTrans = array( 'foo' => 'bar', 'aMonths' => array( 1 => 'January', 2 => 'February', 3 => 'March', 4 => 'April', 5 => 'May', 6 => 'June', 7 => 'July', 8 => 'August', 9 => 'September', 10 => 'October', 11 => 'November', 12 => 'December',) ); $c = new Config(); $root = & $c->parseConfig($aTrans, 'phparray'); $filename = './test.php'; $result = $c->writeConfig($filename, 'phparray', array('name' => 'words')); include($filename); print_r($words) Expected result: ---------------- save file like $words['aMonths'][1] = 'January'; $words['aMonths'][2] = 'February'; Actual result: -------------- file is saved like: $words['aMonths'][0] = 'January'; $words['aMonths'][1] = 'February';

Comments

 [2007-02-06 08:09 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2007-03-23 01:28 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!