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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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: Wed May 07 06:01:29 2025 UTC