note 41140 deleted from function.array-shift by nlopess
| From: | nlopess@php.net | Date: | Mon, 24 May 2004 13:19:16 +0000 |
| Subject: | note 41140 deleted from function.array-shift by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-70018@lists.php.net to get a copy of this message | ||
Note Submitter:
----
>> 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 ...
$vars = array_shift($vars) assignes the first removers the first element from $vars so that $vars ==
array('var2', 'var3').
Then what was the first element of $vars is asssigned to $vars so that $vars == 'var1'.
If your copy of PHP does something different then there is something wrong Frank.