php.net |  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
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: c dot greenNOSP at Mits dot uq dot edu dot au
New email:
PHP Version: OS:

 

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

Cheerio,

Cameron Green

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-07-12 13:10 UTC] maarten@php.net
-Status: Open +Status: Wont fix -Package: Feature/Change Request +Package: *General Issues
 [2013-07-12 13:10 UTC] maarten@php.net
array_slice() does what you want. :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 11:01:31 2024 UTC