|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #66750 The function `array_slice` does not do what it must to do
Submitted: 2014-02-21 12:00 UTC Modified: 2014-02-21 15:48 UTC
From: olarmariusalex at gmail dot com Assigned:
Status: Wont fix Package: Arrays related
PHP Version: 5.4.25 OS: Linux Mint
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: olarmariusalex at gmail dot com
New email:
PHP Version: OS:


 [2014-02-21 12:00 UTC] olarmariusalex at gmail dot com
From manual page:

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`.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-02-21 15:48 UTC]
-Status: Open +Status: Wont fix -Type: Bug +Type: Feature/Change Request -Package: *General Issues +Package: Arrays related
 [2014-02-21 15:48 UTC]
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...
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 17 16:01:28 2024 UTC