#38076 [Opn->Csd]: array_slice() always preserve string keys
| From: | dave@php.net | Date: | Sun, 15 Oct 2006 05:12:42 +0000 |
| Subject: | #38076 [Opn->Csd]: array_slice() always preserve string keys | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969374220@lists.php.net to get a copy of this message | ||
ID: 38076
Updated by: dave@php.net
Reported By: develar at gmail dot com
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: Windows
PHP Version: Irrelevant
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
Previous Comments:
------------------------------------------------------------------------
[2006-07-12 08:17:30] develar at gmail dot com
Description:
------------
Function array_slice() always preserve string keys. The parameter
"preserve_keys" is necessary only for numerical keys. The documentation
is silent about it.
Reproduce code:
---------------
$form = array('one' => 'one value', 'two' => 'two
value', 'three' =>
'three value');
print_r(array_slice($form, 2));
Expected result:
----------------
Array ( [0] => three value )
Actual result:
--------------
Array ( [three] => three value )
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38076&edit=1