note 10243 added to array_merge

From: Date: Wed, 20 Dec 2000 15:56:52 +0000
Subject: note 10243 added to array_merge
Groups: php.notes 
Request: Send a blank email to php-notes+get-8958@lists.php.net to get a copy of this message
As rlynch@ignitionstate.com statet, array_merge kills all integer keys and generates new ones. I've found, that this only happens with values less than 2^31-1 (signed integer). If you use keys greater than 2^32 php recognizes this a strings and leave the keys unchanged. I've you want to preserve the keys, it is recommended to add a string prefix and remove it after merging with, for example, array_walk(). Maybe, for someone this is great feature to clean up an numeric organized array. Joerg Krause www.php.comzept.de http://www.php.net/manual/function.array-merge.php

« previous php.notes (#8958) next »