|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-08-31 11:15 UTC] laruence@php.net
-Status: Open
+Status: Bogus
[2011-08-31 11:15 UTC] laruence@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 02:00:01 2025 UTC |
Description: ------------ The bug is very simple, if you create an array with a custom key, if it detects that the key might be an integer, it will cast that key to an integer automatically. (You have an example below) Test script: --------------- <?php $key1 = "00"; $key2 = "01"; $key3 = "11"; $array[$key1] = ''; $array[$key2] = ''; $array[$key3] = ''; foreach($array as $key => $value) { echo $key.':'.gettype($key).'<br />'; } ?> Expected result: ---------------- 00:string 01:string 11:string Actual result: -------------- 00:string 01:string 11:integer