#21998 [Csd]: array_pop() moves current element pointer since 4.3.0
| From: | php at alterego dot dp dot ua | Date: | Wed, 05 Feb 2003 09:10:21 +0000 |
| Subject: | #21998 [Csd]: array_pop() moves current element pointer since 4.3.0 | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969351610@lists.php.net to get a copy of this message | ||
ID: 21998
User updated by: php@alterego.dp.ua
Reported By: php@alterego.dp.ua
Status: Closed
Bug Type: Documentation problem
Operating System: all
PHP Version: 4.3.0
New Comment:
Thanks for the best web scripting language...
Previous Comments:
------------------------------------------------------------------------
[2003-02-05 01:26:09] philip@php.net
This has been fixed in CVS. See:
http://cvs.php.net/cvs.php/phpdoc/en/reference/array/functions/array-shift.xml
http://cvs.php.net/cvs.php/phpdoc/en/reference/array/functions/array-pop.xml
http://cvs.php.net/diff.php/phpdoc/en/language-snippets.ent?r1=1.38&r2=1.39
Thank you for the report :)
------------------------------------------------------------------------
[2003-02-03 11:02:08] sniper@php.net
I have fixed this now in CVS. But the docs should mention
that the pointer is reset by array_pop/array_shift.
------------------------------------------------------------------------
[2003-02-03 10:51:39] sniper@php.net
Clarification: In PHP 4.2.3, the current array position
was reset after array_pop() and array_shift().
------------------------------------------------------------------------
[2003-02-03 00:39:14] sniper@php.net
magnus@php.net: I reverted my changes, not my fault. :-p
But there is indeed some bug in this, since array_pop()
should not affect the current key.
------------------------------------------------------------------------
[2003-02-01 15:08:57] magnus@php.net
Array related.
One of these commits broke it.
revision 1.180
date: 2002/08/01 17:34:31; author: rodif_bl; state: Exp;
lines: +12 -15
array_pop wasnt setting next index
----------------------------
revision 1.179
date: 2002/08/01 16:44:47; author: sniper; state: Exp;
lines: +1 -4
That was not correct..
----------------------------
revision 1.178
date: 2002/08/01 16:39:52; author: sniper; state: Exp;
lines: +5 -2
Reset index when doing array_pop()
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/21998
--
Edit this bug report at http://bugs.php.net/?id=21998&edit=1