|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-05-19 12:47 UTC] carsten_sttgt at gmx dot de
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 18 07:00:02 2025 UTC |
Description: ------------ When accessing an array element with a string index which forms a number, it is inevitably converted to an integer. Reproduce code: --------------- <?php $a = array(); $b = '1234'; $a['x'] = 'whatever'; $a[$b] = 'whatever2'; foreach ($a as $key=>$value) { echo gettype($key)."\n"; } ?> Expected result: ---------------- string string Actual result: -------------- string integer