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 this is not your bug, you can add a comment by following this link.
If this is your bug, but 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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 14:01:28 2024 UTC