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
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: mlemos at acm dot org
New email:
PHP Version: OS:

 

 [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

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-08-13 16:23 UTC] zeev
This now generates a warning.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jan 02 11:01:29 2025 UTC