Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70091 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58971 invoked from network); 10 Nov 2013 20:58:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Nov 2013 20:58:26 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.52 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.215.52 mail-la0-f52.google.com Received: from [209.85.215.52] ([209.85.215.52:45013] helo=mail-la0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A7/00-58055-073FF725 for ; Sun, 10 Nov 2013 15:58:26 -0500 Received: by mail-la0-f52.google.com with SMTP id eo20so178374lab.39 for ; Sun, 10 Nov 2013 12:58:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=WC7perO7rjTm+ttdxsGMh1UyMnfpeWDupSEf57JyHEc=; b=e+9bB06QcfIQGk2KzM0a1z+MgjhG4qpMJwe3t6vDjTQuS3zq6O4JQA/4ZBSu/Wm77D IErrLd4OmmejYr71+mo4/bvGI7dPDqS34tMTBQFCK4D1lbsk80JVrKhh+MsVe16nS3Uy AjP5as1DpB1TRS7VsmIw7cWwcVNN2NZU4BGttzYYdR5+mRzJmHVJNdsJ/zLlbepogtQV JpI/gyJCBekRapidEqE1kkimMKHhTQf3De3V+eV00wSOq2CiKpWL2ieo4DzhbWRNQiRs L5+Amjt+dAzjC2wvXWXtIK0IUNPdDRURF+C+Xr2ASYIYy25U4n5yD31mVYtNk9KC1YEz vUSQ== X-Received: by 10.152.27.10 with SMTP id p10mr19895724lag.21.1384117101623; Sun, 10 Nov 2013 12:58:21 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.154.201 with HTTP; Sun, 10 Nov 2013 12:57:41 -0800 (PST) In-Reply-To: <38311741.20131110152833@cypressintegrated.com> References: <38311741.20131110152833@cypressintegrated.com> Date: Mon, 11 Nov 2013 05:57:41 +0900 X-Google-Sender-Auth: LGlf0zVL2-UnxnrvYusMmmT9KEs Message-ID: To: Sanford Whiteman Cc: Yasuo Ohgaki Content-Type: multipart/alternative; boundary=089e0158c9f82b7fd004ead8e01e Subject: Re: [PHP-DEV] Re: [RFC] Comparison and conversion inconsistency - need more info From: yohgaki@ohgaki.net (Yasuo Ohgaki) --089e0158c9f82b7fd004ead8e01e Content-Type: text/plain; charset=UTF-8 Hi Sanford, On Mon, Nov 11, 2013 at 5:28 AM, Sanford Whiteman < swhitemanlistens-software@cypressintegrated.com> wrote: > > [yohgaki@dev ~]$ php -r "var_dump((NULL < -100));" > > bool(true) > > Equiv to FALSE < TRUE > > > [yohgaki@dev ~]$ php -r "var_dump((NULL > -100));" > > bool(false) > > Equiv to FALSE > TRUE > > > NULL behaves differently, though. > > Differently from what? It's exactly as specified in the docs. My previous post is wrong. TRUE only evaluated as 1 otherwise FALSE. FALSE/NULL evaluated as 0 or least. That's what we need in document. IMO. However, this behavior seems weird. [yohgaki@dev ~]$ php -r "var_dump((FALSE < -100));" bool(true) [yohgaki@dev ~]$ php -r "var_dump((FALSE > -100));" bool(false) [yohgaki@dev ~]$ php -r "var_dump((TRUE < -100));" bool(false) [yohgaki@dev ~]$ php -r "var_dump((TRUE > -100));" bool(false) It's really confusing to me :( Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --089e0158c9f82b7fd004ead8e01e--