From:             
Operating system: Whatever
PHP version:      5.3.3
Package:          *General Issues
Bug Type:         Feature/Change Request
Bug description:Function like current(), but advancing the internal array 
pointer by one

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.


-- 
Edit bug report at http://bugs.php.net/bug.php?id=52822&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=52822&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=52822&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=52822&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=52822&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=52822&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=52822&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=52822&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=52822&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=52822&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=52822&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=52822&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=52822&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=52822&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=52822&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=52822&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=52822&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=52822&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=52822&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=52822&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=52822&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=52822&r=mysqlcfg

Reply via email to