#41939 [Opn->Bgs]: Bizarre behaviour testing a variable
| From: | scottmac@php.net | Date: | Mon, 09 Jul 2007 14:58:07 +0000 |
| Subject: | #41939 [Opn->Bgs]: Bizarre behaviour testing a variable | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-114804@lists.php.net to get a copy of this message | ||
ID: 41939
Updated by: scottmac@php.net
Reported By: steve at tequilasolutions dot com
-Status: Open
+Status: Bogus
Bug Type: Variables related
Operating System: FC4
PHP Version: 5.2.3
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
Previous Comments:
------------------------------------------------------------------------
[2007-07-09 14:38:46] steve at tequilasolutions dot com
Description:
------------
I have a variable set to 0.
if ($var=="on") returns true!!
This behaviour is not there in php4
Reproduce code:
---------------
admin@ds1009# php -v
PHP 4.3.11 (cgi) (built: Jun 16 2005 17:25:40)
Copyright (c) 1997-2004 The PHP Group
admin@ds1009# php
<?
$val = 0;
if ($val=="on") print "on\n";
?>
admin@ds1009# php5
<?
$val = 0;
if ($val=="on") print "on\n";
?>
on
admin@ds1009# php5
<?
$var = 0;
if ($var=='anything') print "anything";
?>
anythingadmin@ds1009#
This bug is also in PHP/5.0.4 and may have been there since then.
admin@ds1009#
Expected result:
----------------
0 should not equal 'on' or 'anything'
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41939&edit=1