|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-10-06 17:43 UTC] requinix@php.net
-Status: Open
+Status: Feedback
-Package: PHP Language Specification
+Package: Arrays related
[2017-10-06 17:43 UTC] requinix@php.net
[2017-10-06 18:18 UTC] langebroek at gmail dot com
[2017-10-06 18:18 UTC] langebroek at gmail dot com
[2017-10-06 18:28 UTC] requinix@php.net
-Status: Feedback
+Status: Not a bug
[2017-10-06 18:28 UTC] requinix@php.net
[2017-10-07 00:48 UTC] bradyn at bradynpoulsen dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 14:00:01 2025 UTC |
Description: ------------ Rather self explanatory; it seems impossible to have a numeric string as an array key. For the project I'm working on this is almost a necessity. Test script: --------------- $buf=array((string)1=>'x',"2"=>'y','3'=>'z'); #var_dump($buf);//all int var_dump(array_keys($buf));//clarify all int Expected result: ---------------- In at least one case I'd expect to see a string in the array key, or have an alternative method to achieve such. In some cases it is unwise to typecast at a later time. Actual result: -------------- array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) }