note 40987 deleted from function.array-shift by nlopess
| From: | nlopess@php.net | Date: | Mon, 24 May 2004 13:19:15 +0000 |
| Subject: | note 40987 deleted from function.array-shift by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-70017@lists.php.net to get a copy of this message | ||
Note Submitter: frank@codedor.be
----
it had me baffled for a while, but it is probably documented somewhere as normal behaviour for
array_shift :
$vars = array('var1', 'var2', 'var3') ;
$vars = array_shift($vars) ;
will return :
var2, var3, var1
and NOT :
var2, var3
as I first thought ...
in other terms : if you do not name another array to store the array_shift in - the shifted key is
added to the back, and not removed from the array
kept me boggled for a while, might help someone :)