|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-03-01 21:46 UTC] cmb@php.net
-Status: Open
+Status: Not a bug
-Assigned To:
+Assigned To: cmb
[2018-03-01 21:46 UTC] cmb@php.net
[2018-03-01 22:08 UTC] c dot rideron at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 13:00:01 2025 UTC |
Description: ------------ Numeric keys in object convert as string keys to array. And I can't access to this keys after conversion, because PHP automatic convert string numeric keys to integer. In 7.1 too... Test script: --------------- $a=new stdClass(); $a->{1}=1; $a->{2}=2; $a->{3}=3; $b=(array)$a; var_dump([$b,1,@$b[1]]); ----------------------------------------- [0]=> array(3) { ["1"]=> int(1) ["2"]=> int(2) ["3"]=> int(3) } [1]=> int(1) [2]=> NULL