php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6766 problem with comparing stings with zero
Submitted: 2000-09-14 18:20 UTC Modified: 2000-09-17 18:54 UTC
From: geoffphillips at hotmail dot com Assigned:
Status: Closed Package: *General Issues
PHP Version: 4.0.1 OS: suse linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: geoffphillips at hotmail dot com
New email:
PHP Version: OS:

 

 [2000-09-14 18:20 UTC] geoffphillips at hotmail dot com
setup:
standard php4 install from suse linux 6.4 cd edition

bug:
all strings compared for equality with zero, evaluates to true
e.g.
if ("abcd" == 0")
	print "hello";
always prints "hello"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-09-14 23:12 UTC] sniper@php.net
Use === instead of ==.

--Jani
 [2000-09-17 18:54 UTC] geoffphillips at hotmail dot com
setup:
standard php4 install from suse linux 6.4 cd edition

bug:
all strings compared for equality with zero, evaluates to true
e.g.
if ("abcd" == 0)
	print "hello";
always prints "hello"
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 17:01:33 2024 UTC