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
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:
7 + 23 = ?
Subscribe to this entry?

 
 [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: Wed Apr 24 03:01:29 2024 UTC