|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-07-09 14:58 UTC] scottmac@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 21 09:00:02 2025 UTC |
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'