Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41975 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13574 invoked from network); 17 Nov 2008 13:19:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Nov 2008 13:19:05 -0000 Authentication-Results: pb1.pair.com smtp.mail=federico.lebron@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=federico.lebron@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.19 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: federico.lebron@gmail.com X-Host-Fingerprint: 209.85.217.19 mail-gx0-f19.google.com Received: from [209.85.217.19] ([209.85.217.19:39623] helo=mail-gx0-f19.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F6/A5-17095-84F61294 for ; Mon, 17 Nov 2008 08:19:05 -0500 Received: by gxk12 with SMTP id 12so1125421gxk.23 for ; Mon, 17 Nov 2008 05:19:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=6rWs/aAe7okJUVRLvyiv8ZBWK7p8iOMyPmyPFjZEtcA=; b=LYt91wBf5eg6uuncIYKCcpGY+BzE8AZCd3Kmy4IEY/6cWLP9qHiNVcFipxV+dDuHmE HGjKlRr2GlYcAHldUVzAWy7SLSUr4N+8mSq6N/yTHCcOua0QJ3aKSYTuFh34O1KRuinC fQ6BBCkRp10LewxCmHr0LUQdBKf+moQFQ8A9s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=D1EAE3jaqdUoxINjBv+z8jRJFYAjB86osyW6+7uOYaJ8FVBU8ia73+0vmVH7k2z+Tq sKH+yHIpV9jU/vIpONsfIbMQhpl2TBD8b8Ryr4PEkMu8c1+YaiVcKSnXOqcGu9jqwAyB JiIUwz0Dz0txtVtCIPM4DJlM0uUmbdfiFKxXo= Received: by 10.151.106.7 with SMTP id i7mr7900464ybm.147.1226927941498; Mon, 17 Nov 2008 05:19:01 -0800 (PST) Received: from ?192.168.1.168? ([200.41.67.19]) by mx.google.com with ESMTPS id i27sm3573876elf.14.2008.11.17.05.18.59 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 17 Nov 2008 05:19:00 -0800 (PST) Message-ID: <49217D20.9030601@gmail.com> Date: Mon, 17 Nov 2008 11:18:08 -0300 User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: Andrew Rose CC: Ting Chen , internals@lists.php.net References: <229284780811170445r46ad09d6tc1c295b4395fd5b2@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] a stupid question From: federico.lebron@gmail.com (Federico Lebron) Andrew Rose wrote: > 2008/11/17 Ting Chen : >> Hi everybody, >> >> sorry this is a greenhand's stupid question. Why isn't "0.0" false? I >> know it is a string but I still think it equals to 0. >> > > I think you answered your own question there. > > Andrew > What he means is that == is not transitive. That is, "0" == false "0" == "0.0" But false != "0.0" The answer to "why" is, well, that's the way it is. "0.0" just "looks" too much like a string, maybe, to be made into a boolean. You can just cast it into int like (int) "0.0" to make it work, however. Federico Lebron