|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-09-04 08:04 UTC] reeze dot xia at gmail dot com
[2012-09-04 08:18 UTC] janfili+phpbugs at gmail dot com
[2012-09-04 08:19 UTC] reeze dot xia at gmail dot com
[2012-09-04 08:21 UTC] reeze dot xia at gmail dot com
[2012-09-04 11:17 UTC] laruence@php.net
[2012-09-04 11:17 UTC] laruence@php.net
-Status: Open
+Status: Not a bug
[2012-09-04 11:39 UTC] janfili+phpbugs at gmail dot com
[2012-09-04 13:17 UTC] laruence@php.net
[2012-09-04 14:16 UTC] janfili+phpbugs at gmail dot com
[2012-09-04 14:37 UTC] laruence@php.net
[2012-09-04 14:38 UTC] reeze dot xia at gmail dot com
[2012-09-04 16:21 UTC] janfili+phpbugs at gmail dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 11:00:01 2025 UTC |
Description: ------------ after json en/decoding the original array index cant be used to retrieve the values. however foreach and all other array-related functions work as expected. Test script: --------------- <? $class = new stdClass(); $class->field = 'foo'; var_dump($class); $array = array(1 => $class); var_dump($array); $json_sting = json_encode($array); var_dump($json_sting); $array_obj = json_decode($json_sting); var_dump($array_obj); $array = (array) $array_obj; var_dump($array); var_dump($array[1]); ?> Expected result: ---------------- output of last var_dump is expected to be object(stdClass)#3 (1) { ["field"]=> string(3) "foo" } Actual result: -------------- NULL