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