ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-dev
php-dev
#37021 [NEW]: the determination of condition was wrong
by Liber At Iproom Dot Com other posts by this author
Apr 8 2006 12:00PM messages near this date
#37024 [Opn->Bgs]: Can't access file via file:// | #37021 [Opn->Bgs]: the determination of condition was wrong
From:             liber at iproom dot com
Operating system: Windows XP
PHP version:      5.1.3RC2
PHP Bug Type:     *General Issues
Bug description:  the determination of condition was wrong 

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

-- 
Edit bug report at http://bugs.php.net/?id=37021&edit=1
-- 
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37021&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=37021&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37021&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=37021&r=fixedcvs
Fixed in release:             http://bugs.php.net/fix.php?id=37021&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=37021&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=37021&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=37021&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=37021&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=37021&r=notwrong
Not enough info:              http://bugs.php.net/fix.php?id=37021&r=notenoughinfo
Submitted twice:              http://bugs.php.net/fix.php?id=37021&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=37021&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=37021&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=37021&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=37021&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=37021&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=37021&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=37021&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=37021&r=mysqlcfg
Thread:
Liber At Iproom Dot Com
tony2001

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved