php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #633 PHP compares arrays wrongly
Submitted: 1998-08-08 22:56 UTC Modified: 1998-08-13 16:23 UTC
From: mlemos at acm dot org Assigned:
Status: Closed Package: Parser error
PHP Version: 3.0 Final Release OS: Amiga OS
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
38 - 34 = ?
Subscribe to this entry?

 
 [1998-08-08 22:56 UTC] mlemos at acm dot org
It seems that PHP either is not ready to compare arrays or
it just compares different arrays wrongly saying they are
equal.

Just try this:

<?
   $array_1=array("1");
   $array_2=array("2");
   if($array_1!=$array_2)
    echo "Different\n";
   else
    echo "Equal\n";
?>

If  PHP is not ready to compare arrays or objects for the matter, it should
issue  an  error or a warning at least when you have error reporting set to
15.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-08-13 16:23 UTC] zeev
This now generates a warning.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 09:01:28 2024 UTC