Bug->Req #66750 [Opn->Wfx]: The function `array_slice` does not do what it must to do

From: Date: Fri, 21 Feb 2014 15:48:09 +0000
Subject: Bug->Req #66750 [Opn->Wfx]: The function `array_slice` does not do what it must to do
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-184384@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66750&edit=1

 ID:                 66750
 Updated by:         nikic@php.net
 Reported by:        olarmariusalex at gmail dot com
 Summary:            The function array_slice does not do what it must
                     to do
-Status:             Open
+Status:             Wont fix
-Type:               Bug
+Type:               Feature/Change Request
-Package:            *General Issues
+Package:            Arrays related
 Operating System:   Linux Mint
 PHP Version:        5.4.25
 Block user comment: N
 Private report:     N

 New Comment:

We won't be changing the default value of $preserve_keys. That would just be a pointless BC
break. If you want the keys to be preserved, just set it...


Previous Comments:
------------------------------------------------------------------------
[2014-02-21 12:00:51] olarmariusalex at gmail dot com

Description:
------------
---
From manual page: http://www.php.net/function.array-slice
---

The function array_slice just have to Extract a slice of the array, and
must not change the array data(keys or values). Because of the default parameter value
$preserve_keys = false, this bug appears. To resolve this issue the default parameter
value must be: $preserve_keys = true.



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=66750&edit=1


Thread (2 messages)

« previous php.bugs (#184384) next »