PHP 4.0 Bug #4875: array_merge() is unable to merge arrays with numeric keys
| From: | waldschrott at kiffen dot de | Date: | Wed, 07 Jun 2000 17:29:59 +0000 |
| Subject: | PHP 4.0 Bug #4875: array_merge() is unable to merge arrays with numeric keys | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-20483@lists.php.net to get a copy of this message | ||
From: waldschrott@kiffen.de
Operating system: all
PHP version: 4.0.0 Release
PHP Bug Type: Feature/Change Request
Bug description: array_merge() is unable to merge arrays with numeric keys
array_merge() is unable to merge arrays with numeric keys (as described in the documentation),
however that´s usefull sometimes and should be possible, in face of the fact that even casting the
keys to (string) they´re saved as (int)s.
workaround:
to merge arrays with numeric keys you can save all keys with a string prefix 'a'.$int for
example, after extracting the key do a substr($key,1)