php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64520 in_array question
Submitted: 2013-03-26 11:05 UTC Modified: 2013-03-26 20:58 UTC
From: 243008827 at qq dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.4Git-2013-03-26 (snap) OS: win
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: 243008827 at qq dot com
New email:
PHP Version: OS:

 

 [2013-03-26 11:05 UTC] 243008827 at qq dot com
Description:
------------
asdfsssssssssssssssssssssssss

Test script:
---------------
var_export(in_array(0,array('a')));//true
var_export(in_array(false,array('a')));//false
var_export(in_array('',array('a')));//false
var_export(in_array(null,array('a')));//false
var_export(in_array('0',array('a',0)));//true

Expected result:
----------------
ss

Actual result:
--------------
sss

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-03-26 11:25 UTC] laruence@php.net
-Status: Open +Status: Not a bug
 [2013-03-26 11:25 UTC] laruence@php.net
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

in_array does *loose comparison*
 [2013-03-26 20:58 UTC] sixd@php.net
-Summary: asdfsssssssssssssssssssssssss +Summary: in_array question
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat May 03 20:01:31 2025 UTC