Re: in_array() 4.0.0 -> 4.0.2

From: Date: Mon, 11 Sep 2000 19:14:01 +0000
Subject: Re: in_array() 4.0.0 -> 4.0.2
Groups: php.general 
Request: Send a blank email to php-general+get-16215@lists.php.net to get a copy of this message
> The purpose of in_array() is to say if an item is in the array, > with a rather nice side effect of re-positioning the array pointer > to that element. > > How are we to find the position of the element? > > I don't want to have to do an expensive for loop every time I > want to get an index. > > Short of coding up a my_in_array() what are the alternatives? Hmm, I didn't realize people relied on that behavior. It's possible to change it back to the old one, but still implement a check that if the element is not found the pointer is reset to the beginning of the array, but I guess I'd like to hear more opinions about this before doing any changes. -Andrei * On the keyboard of life, always keep one finger on the escape key. *

« previous php.general (#16215) next »