Re: Bug in array_search()
| From: | Jason Greene | Date: | Mon, 04 Feb 2002 16:37:38 +0000 |
| Subject: | Re: Bug in array_search() | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-79110@lists.php.net to get a copy of this message | ||
I just read the paragraph below, sorry I was replying in a hurry.
Originally it was the intended behavior for array_search to default to
strict, but it was decided to make its behavior follow in_array exactly.
-Jason
On Sun, 2002-02-03 at 13:24, Sebastian Bergmann wrote:
> array_search() always returns true when one of the array's values is
> 'true':
>
> <?php
> $array = array('foo' => true);
>
> if (array_search('this', $array) !== false) {
> echo 'is this a bug?';
> }
> ?>
>
> Setting the third, optional parameter to true solves this problem, but
> I doubt that this is the intended behaviour...
>
> --
> Sebastian Bergmann
> http://sebastian-bergmann.de/
> http://phpOpenTracker.de/
>
> Did I help you? Consider a gift:
> http://wishlist.sebastian-bergmann.de/
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
Jason T. Greene
Internet Software Engineer
<jason@inetgurus.net>
<jason@php.net>
<jason.greene@tdstelecom.com>
Use PHP: http://www.php.net