Re: RFC array functions
| From: | Pierre | Date: | Sun, 28 May 2006 01:20:15 +0000 |
| Subject: | Re: RFC array functions | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-23737@lists.php.net to get a copy of this message | ||
On Sat, 27 May 2006 23:52:41 +0200
helly@php.net (Marcus Boerger) wrote:
> Hello Matthew,
>
> Saturday, May 27, 2006, 11:36:16 PM, you wrote:
>
> > Pierre wrote:
> >> On 5/27/06, Marcus Boerger <helly@php.net> wrote:
> >>> - bool array(array $array)
> >>>
> >>> cehcks whether arra position is valid (e.g. like
> >>> "key($array) !== NULL")
> >>
> >> I don't understand this one.
> >>
>
> > I think you have to listen to psychedelic music and take a hit of
> > LSD first.
>
> Actually the point is that you cannot simply do stuff like
> "while(key($array))". And "while(key($array) != 0)" doesn't work
> either. Also "if (!key($array))" is probably different from what you
> expect. And of course "isset(key($array))" doens't work either.
Ok, I got it now.
The name is a bit confusing, array_valid has a different meaning that
what it would do. array_key_valid is already better.
However I still prefer to write:
(key($arr) !== NULL)
+0 here :)
-- Pierre