#23626 [Opn->Bgs]: in_array and array_search stop at value 0

From: Date: Thu, 15 May 2003 02:08:26 +0000
Subject: #23626 [Opn->Bgs]: in_array and array_search stop at value 0
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-39678@lists.php.net to get a copy of this message
 ID:               23626
 Updated by:       iliaa@php.net
 Reported By:      jjkola at email dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Arrays related
 Operating System: Win2000
 PHP Version:      4CVS-2003-05-14 (stable)
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php

http://www.php.net/manual/en/function.in-array.php

Read the online docs :)


Previous Comments:
------------------------------------------------------------------------

[2003-05-14 14:33:21] jjkola at email dot com

Sorry, for still setting this open but I would like to know where that
information is located.

------------------------------------------------------------------------

[2003-05-14 13:24:54] jjkola at email dot com

May I know where that information is located? I didn't see it in manual
(chm-version, May 11 2003). 

in_array:

"Searches haystack for needle and returns TRUE if it is found in the
array, FALSE otherwise."
And there is also mention about that strict-parameter

array_search:

"Searches haystack for needle and returns the key if it is found in the
array, FALSE otherwise"

"This function may return Boolean FALSE, but may also return a
non-Boolean value which evaluates to FALSE, such as 0 or ""."

------------------------------------------------------------------------

[2003-05-14 13:03:04] sniper@php.net

There is not bug. (documented behaviour)



------------------------------------------------------------------------

[2003-05-14 12:25:41] jjkola at email dot com

Yes, I know that strict-parameter, but I still think this isn't how it
should behave. In my opinion it shouldn't stop going through the array
when it finds zero and especially because it's telling misleading
information. Now I'm forced to use that strict-parameter to make it
behave in right and predictable way.

------------------------------------------------------------------------

[2003-05-14 06:31:33] edink@php.net

See the manual entry for in_array (3rd argument).

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/23626

-- 
Edit this bug report at http://bugs.php.net/?id=23626&edit=1



Thread (7 messages)

« previous php.bugs (#39678) next »