note 105578 added to function.array-keys
| From: | pat dot leblanc at gmail dot com | Date: | Mon, 29 Aug 2011 21:05:43 +0000 |
| Subject: | note 105578 added to function.array-keys | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-182816@lists.php.net to get a copy of this message | ||
It's worth noting that if you have keys that are long integer, such as
'329462291595', they will be considered as such on a 64bits system, but will be of type
string on a 32 bits system.
for example:
<?php
$importantKeys = array('329462291595' =>null, 'ZZ291595' => null);
foreach(array_keys($importantKeys) as $key){
echo gettype($key)."\n";
}
?>
will return on a 64 bits system:
<?php
integer
string
?>
but on a 32 bits system:
<?php
string
string
?>
I hope it will save someone the huge headache I had :)
----
Server IP: 72.55.140.6
Probable Submitter: 209.71.202.61
----
Manual Page -- http://www.php.net/manual/en/function.array-keys.php
Edit -- https://master.php.net/note/edit/105578
Del: integrated -- https://master.php.net/note/delete/105578/integrated
Del: useless -- https://master.php.net/note/delete/105578/useless
Del: bad code -- https://master.php.net/note/delete/105578/bad+code
Del: spam -- https://master.php.net/note/delete/105578/spam
Del: non-english -- https://master.php.net/note/delete/105578/non-english
Del: in docs -- https://master.php.net/note/delete/105578/in+docs
Del: other reasons-- https://master.php.net/note/delete/105578
Reject -- https://master.php.net/note/reject/105578
Search -- https://master.php.net/manage/user-notes.php