Re: note 27244 added to function.array-shift
| From: | Jesus M. Castagnetto | Date: | Fri, 29 Nov 2002 02:14:29 +0000 |
| Subject: | Re: note 27244 added to function.array-shift | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-40093@lists.php.net to get a copy of this message | ||
Hmm, no. It is your logic the one that is incorrect,
think about it (again) and you will see why the while
loops stops when $elem is zero.
Your note will be removed.
--- riktigt@rack1.php.net, at@rack1.php.net,
dryg@rack1.php.net, org@rack1.php.net wrote:
> This function doesn't return 0-values, it even stops
> in the example below:
>
> $fiveElems = array(10, 5, 0, 5, 10);
> while ($elem = @array_shift($fiveElems))
> echo $elem . " ";
>
> would return "10 5 ".
>
> See
>
http://kylie.hemmet.chalmers.se/php-array-shift-bug.php
> --
>
http://www.php.net/manual/en/function.array-shift.php
>
http://master.php.net/manage/user-notes.php?action=edit+27244
>
http://master.php.net/manage/user-notes.php?action=delete+27244
>
http://master.php.net/manage/user-notes.php?action=reject+27244
>
>
> --
> PHP Notes Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
=====
--- Jesus M. Castagnetto <jmcastagnetto@php.net>
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com