note 40987 added to function.array-shift

From: Date: Thu, 25 Mar 2004 16:37:34 +0000
Subject: note 40987 added to function.array-shift
Groups: php.notes 
Request: Send a blank email to php-notes+get-67170@lists.php.net to get a copy of this message
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 :) ---- Manual Page -- http://www.php.net/manual/en/function.array-shift.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+40987 Delete -- http://master.php.net/manage/user-notes.php?action=delete+40987&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+40987&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#67170) next »