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

Bug #2118 PEAR Wddx is wrong with associative arrays
Submitted: 2004-08-13 00:01 UTC
From: ez at daoldskool dot org Assigned: alan_k
Status: Closed Package: XML_Wddx
PHP Version: 4.3.6 OS: Windows / Linux
Roadmaps: (Not assigned)    
Subscription  


 [2004-08-13 00:01 UTC] ez at daoldskool dot org
Description: ------------ PEAR Wddx library has a buggy data types handler when serializing associative php arrays (collections/hash tables/dictionnaries...) with non strictly sequential numeric keys it is interpreting keys as indexes for normal real php arrays as a result keys are lost another minor bug is when dealing with numeric string http://www.peoplemode.com/__dev/test/XML_wddx/PEAR/ Reproduce code: --------------- http://www.peoplemode.com/__dev/test/XML_wddx/PEAR/ Expected result: ---------------- should have struct nodes Actual result: -------------- got array nodes instead and numeric keys are lost

Comments

 [2004-08-13 01:07 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!
 [2004-08-13 01:31 UTC] ez at daoldskool dot org
sure Alan but you forgot the most important: _serializeValue did you carefully take a look at the diff : http://www.peoplemode.com/__dev/test/XML_wddx/PEAR/index.php?debug=2&libdiff what's the use of adding _isInt and _isAssoc private methods if you don't call them somewhere besides your swith/case tests are always wrong: switch (gettype($value)) { case 'string': ... you should have this instead: switch (strtolower(gettype($value))) { case 'string': ... anyway my fixes in _serializeValue private methods don't need gettype anymore as it is not strictly reliable best regards Antonin
 [2004-08-13 01:36 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!
 [2004-08-13 01:53 UTC] ez at daoldskool dot org
OK we do agree now. Thanx for considering my bug submission. Will you commit the changes in your next release ?
 [2004-08-13 01:54 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!
 [2004-08-13 02:01 UTC] ez at daoldskool dot org
sure Alan here is the test: http://www.peoplemode.com/__dev/test/XML_wddx/PEAR/#code2 no more diffs the array is now correctly serialized and when re-serialize it again i got the full array back ;) best regards Antonin
 [2004-08-13 02:10 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!