ID: 32121 User updated by: jbeall at heraldic dot us Reported By: jbeall at heraldic dot us Status: Open Bug Type: Arrays related Operating System: Linux PHP Version: 5.0.3 New Comment:
As I mentioned earlier I am unable to add a new comment without changing the status from feedback to something else. "open" and "closed" are the only options I am presented with. Previous Comments: ------------------------------------------------------------------------ [2005-03-08 19:36:06] jbeall at heraldic dot us I have not had a chance to try the snapshot. I will do that as soon as I have the opportunity. ------------------------------------------------------------------------ [2005-03-06 16:50:31] [EMAIL PROTECTED] Did you or did you not try the snapshot? ------------------------------------------------------------------------ [2005-03-01 01:10:09] jbeall at heraldic dot us I have tracked down the problem to WDDX not properly serializing arrays. Consider the following: $data = array(1=>"First value",2=>"Second Value",3=>"Third Value"); $wddxPacket = wddx_serialize_value($data); $deserialized = wddx_deserialize($wddxPacket); echo gettype($deserialized[1])." {$deserialized[1]}\n"; var_dump($deserialized); It outputs: NULL array(3) { ["1"]=> string(11) "First value" ["2"]=> string(12) "Second Value" ["3"]=> string(11) "Third Value" } You will note that the indices are now string values rather than integers. This is apparently because the array begins at an index other than 0. The expected output is of course: string First value array(3) { [1]=> string(11) "First value" [2]=> string(12) "Second Value" [3]=> string(11) "Third Value" } Perhaps this should be filed as a separate bug report, or is already a known bug? As far as changing the status, the only statuses that I am able to set it to are "open" and "closed" - "feedback" is not listed as one of my options. ------------------------------------------------------------------------ [2005-02-27 13:59:28] jbeall at heraldic dot us Actually I just had a possible epiphany - I am serializing the entire $_POST variable using WDDX and recovering on a subsequent page by deserializing the WDDX packet. I wonder if when WDDX deserializes an array, it stores everything at string indices, even if the indices are integers. Note that for convenience reasons the arrays in question start at [1], not [0]; that may be significant, I don't know enough about PHP's WDDX functionality to say. I will not be able to investigate this further for several days, but I will post back when I can. ------------------------------------------------------------------------ [2005-02-27 13:25:43] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip ALWAYS try the snapshots first. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/32121 -- Edit this bug report at http://bugs.php.net/?id=32121&edit=1