#48557 [Asn]: Numeric string keys in Apache Hashmaps are not cast to integers
| From: | kirila dot adamova at bitextender dot com | Date: | Mon, 15 Jun 2009 14:11:48 +0000 |
| Subject: | #48557 [Asn]: Numeric string keys in Apache Hashmaps are not cast to integers | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-138318@lists.php.net to get a copy of this message | ||
ID: 48557
User updated by: kirila dot adamova at bitextender dot com
Reported By: kirila dot adamova at bitextender dot com
Status: Assigned
Bug Type: SOAP related
Operating System: Mac OS X 10.5.7
PHP Version: 5.3.0RC3
Assigned To: dmitry
New Comment:
Patch updated to use zend_symtable_update() instead of
is_numeric_string() checks.
Test case also updated to reflect the (now correct) handling of string
keys with leading zeros.
All in all a better and simpler patch. Thanks to Matt Wilmas for
pointing this out!
Previous Comments:
------------------------------------------------------------------------
[2009-06-15 10:38:14] kirila dot adamova at bitextender dot com
Test case: http://pastie.org/512338
WSDL for test: http://pastie.org/512339
Patch: http://pastie.org/512337
------------------------------------------------------------------------
[2009-06-15 10:34:49] kirila dot adamova at bitextender dot com
Description:
------------
When receiving a SOAP response that contains an Apache "Map" encoded
hashmap, PHP will not decode numeric string keys to integers. As a
result, those items in the map are never accessible, because an array
access with a numeric string key implicitly casts the value to an
integer before doing a value lookup.
Reproduce code:
---------------
(test case and patch to be attached)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48557&edit=1