php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4865 Problem with != and 0
Submitted: 2000-06-07 14:43 UTC Modified: 2000-06-12 18:04 UTC
From: lwillis at plus dot net dot uk Assigned:
Status: Closed Package: Other
PHP Version: 4.0.0 Release OS: Linux 2.2.14
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: lwillis at plus dot net dot uk
New email:
PHP Version: OS:

 

 [2000-06-07 14:43 UTC] lwillis at plus dot net dot uk
The following script produces unexpected results:

<?

$tmp = 0;
if ($tmp != "JBIJI") {
    echo "is true";
} else {
    echo "is false";
}

?>

This produces "is false" as output where I would have thought that since the value of $tmp isn't "JBIJI" the expression "$tmp != 'JBIJI'" should evaluate true??

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-06-12 17:53 UTC] lwillis at plus dot net dot uk
Apparently this is a 'usage/documentation' issue and not a PHP 'bug' per se. I'm happy for this to be closed now.
 [2000-06-12 18:02 UTC] stas at cvs dot php dot net
closed per user request
 [2000-06-12 18:04 UTC] stas at cvs dot php dot net
closed this time
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Mar 13 17:01:30 2025 UTC