|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-09-13 09:30 UTC] aharvey@php.net
-Status: Open
+Status: Wont fix
[2010-09-13 09:30 UTC] aharvey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 16:00:02 2025 UTC |
Description: ------------ It would be great to have a function which is just like current, with the difference that it advances the array pointer to the next element after reading the current value. When using current() in a loop, you always have to call next(). Including a function that acts like current() while automatically advancing the array pointer would be more elegant. It can be implemented in PHP userland like this: function currentPlusOne($array) { $element = current($array); next($array); return $element; } A native implementation among current(), next() etc. would be ideal, of course.