For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > October 2006 > #38076 [Opn->Csd]: array_slice() always preserve string keys









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author #38076 [Opn->Csd]: array_slice() always preserve string keys
dave@php.net

2006-10-15, 3:56 am

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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com