php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #21351 in_array return false if not array
Submitted: 2003-01-02 14:47 UTC Modified: 2003-01-02 16:08 UTC
From: marc at rushland dot net Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.2.1 OS: All
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: marc at rushland dot net
New email:
PHP Version: OS:

 

 [2003-01-02 14:47 UTC] marc at rushland dot net
When you pass a non-array as the second arguement (i.e. the haystack) to
in_array(), I think it would be more useful if PHP simply returned FALSE,
instead of issuing a WARNING error.

Checking an array against is_array() before calling in_array() in a
conditional expression only leads to more complicated code when I think it
is quite logical for PHP to simply return false.

Marc.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-02 15:30 UTC] marc at rushland dot net
This is an accidental duplicate of #21350.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC