Doc #70654 [NEW]: array_map key preservation behaviour not explicit
| From: | lucas at threeam dot com dot au | Date: | Wed, 07 Oct 2015 02:29:28 +0000 |
| Subject: | Doc #70654 [NEW]: array_map key preservation behaviour not explicit | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-12807@lists.php.net to get a copy of this message | ||
From: lucas at threeam dot com dot au
Operating system:
PHP version: Irrelevant
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:array_map key preservation behaviour not explicit
Description:
------------
---
From manual page: http://www.php.net/function.array-map
---
Not a dupe of, but related to #43612.
The page says (too far down) that "If the array argument contains string
keys then the returned array will contain string keys if and only if
exactly one array is passed. If more than one argument is passed then
the returned array always has integer keys."
Whereas the actual behaviour is "The returned array will preserve the
keys of the array argument if and only if exactly one array is passed.
If more than one array is passed, the returned array will have
sequential, integer keys."
It would be great if this was official so we could rely on it.
--
Edit bug report at https://bugs.php.net/bug.php?id=70654&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70654&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70654&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70654&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=70654&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=70654&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=70654&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=70654&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=70654&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=70654&r=support
Expected behavior: https://bugs.php.net/fix.php?id=70654&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=70654&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=70654&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=70654&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70654&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=70654&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=70654&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=70654&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70654&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=70654&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=70654&r=mysqlcfg