Req #21379 [Opn->Wfx]: Add integer to pop and unshift
| From: | maarten@php.net | Date: | Fri, 12 Jul 2013 13:10:18 +0000 |
| Subject: | Req #21379 [Opn->Wfx]: Add integer to pop and unshift | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-180225@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=21379&edit=1
ID: 21379
Updated by: maarten@php.net
Reported by: c dot greenNOSP at Mits dot uq dot edu dot au
Summary: Add integer to pop and unshift
-Status: Open
+Status: Wont fix
Type: Feature/Change Request
-Package: Feature/Change Request
+Package: *General Issues
Operating System: RH 7.3
PHP Version: 4.3.0
Block user comment: N
Private report: N
New Comment:
array_slice() does what you want. :)
Previous Comments:
------------------------------------------------------------------------
[2003-01-02 22:10:03] 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
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=21379&edit=1