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
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: 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

Pull Requests

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-2026 The PHP Group
All rights reserved.
Last updated: Fri Jul 03 06:00:01 2026 UTC