php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5469 null string tests equal to integer zero
Submitted: 2000-07-08 20:46 UTC Modified: 2000-07-09 00:00 UTC
From: bill at rsv dot ricoh dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.1pl2 OS: RH6.1
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:
33 - 6 = ?
Subscribe to this entry?

 
 [2000-07-08 20:46 UTC] bill at rsv dot ricoh dot com
if (0*0 =="")
     echo "<font color='red'>Oops!  0 == \"\"</font>";
else
     echo "<font color='green'>OK  0 != \"\"</font>";


'./configure' '--with-mysql' '--with-apache=../apache_1.3.12' '--enable-track-vars'

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-09 00:00 UTC] bill at rsv dot ricoh dot com
The '==' operator tests numerical equality REGARDLESS OF TYPE, hence the results are correct.  The '===' operator tests equality of value AND type, and would yield the desired results here.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 30 19:01:29 2024 UTC