|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #21379 Add integer to pop and unshift
Submitted: 2003-01-02 22:10 UTC Modified: 2013-07-12 13:10 UTC
From: c dot greenNOSP at Mits dot uq dot edu dot au Assigned:
Status: Wont fix Package: *General Issues
PHP Version: 4.3.0 OS: RH 7.3
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2003-01-02 22:10 UTC] c dot greenNOSP at Mits dot uq dot edu dot au
It would be nice if pop and unshift had an optional integer argument.  This would be useful for retreiving or removing the first or last n elements of an array.  

If the default is left as 1, then no current code will be affected, and the functions would be extended in an intuitive way.


Cameron Green


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-07-12 13:10 UTC]
-Status: Open +Status: Wont fix -Package: Feature/Change Request +Package: *General Issues
 [2013-07-12 13:10 UTC]
array_slice() does what you want. :)
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Jul 22 03:01:26 2019 UTC