Re: in_array() 4.0.0 -> 4.0.2
| From: | Rasmus Lerdorf | Date: | Thu, 07 Sep 2000 18:07:39 +0000 |
| Subject: | Re: in_array() 4.0.0 -> 4.0.2 | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-15759@lists.php.net to get a copy of this message | ||
> The functionality of in_array has changed between 4.0.0 -> 4.0.2
>
> The difference is that in x.2 in_array() moves the internal array
> pointer to the found item; and in x.0 it dose not.
>
> Can anyone tell me why the change was made? And is the x.0
> version a bug or is the x.2 version a bug?
Hrm. I remember asking Andrei to change this. Although not exactly
this. What I didn't like was that if an element wasn't found in the
array, the array pointer ended up at the end of the array. He fixed that,
but I didn't realize that this also changed the nature of a match. The
question is whether or not in_array() should affect the array pointer at
all. I am not sure it should.
-Rasmus