php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37021 the determination of condition was wrong
Submitted: 2006-04-08 19:00 UTC Modified: 2006-04-08 19:11 UTC
From: liber at iproom dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.1.3RC2 OS: Windows XP
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: liber at iproom dot com
New email:
PHP Version: OS:

 

 [2006-04-08 19:00 UTC] liber at iproom dot com
Description:
------------
if the string is starting by characters,
it will be true if compare with zero.


Reproduce code:
---------------
$a="a.1afdsfdsfsd";

if($a==0) {
	echo "YES";
}
shows YES

$a=".1afdsfdsfsd";

if($a==0) {
	echo "YES";
}
shows nothing

$a="1afdsfdsfsd";

if($a==0) {
	echo "YES";
}
shows nothing

Expected result:
----------------
$a="a.1afdsfdsfsd";

if($a==0) {
	echo "YES";
}
shows nothing

Actual result:
--------------
$a="a.1afdsfdsfsd";

if($a==0) {
	echo "YES";
}
shows YES

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-08 19:11 UTC] tony2001@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 08:00:02 2026 UTC