Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70090 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56522 invoked from network); 10 Nov 2013 20:28:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Nov 2013 20:28:43 -0000 Authentication-Results: pb1.pair.com smtp.mail=swhitemanlistens-software@cypressintegrated.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=swhitemanlistens-software@cypressintegrated.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain cypressintegrated.com designates 173.1.104.101 as permitted sender) X-PHP-List-Original-Sender: swhitemanlistens-software@cypressintegrated.com X-Host-Fingerprint: 173.1.104.101 rproxy2-b-iv.figureone.com Windows 2000 SP2+, XP SP1 (seldom 98 4.10.2222) Received: from [173.1.104.101] ([173.1.104.101:55573] helo=rproxy2-b-iv.figureone.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 92/D2-42270-B7CEF725 for ; Sun, 10 Nov 2013 15:28:43 -0500 Received: from localhost ([216.220.114.66]) by rproxy2-b-iv.figureone.com (Brand New Heavy v1.0) with ASMTP id VFM90240 for ; Sun, 10 Nov 2013 12:28:40 -0800 Date: Sun, 10 Nov 2013 15:28:33 -0500 Reply-To: Sanford Whiteman X-Priority: 3 (Normal) Message-ID: <38311741.20131110152833@cypressintegrated.com> To: Yasuo Ohgaki In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: [RFC] Comparison and conversion inconsistency - need more info From: swhitemanlistens-software@cypressintegrated.com (Sanford Whiteman) > I still didn't get it right :( Please, please read the documentation for comparison, juggling, and precedence. > [yohgaki@dev ~]$ php -r "var_dump((TRUE > 100));" > bool(false) Equiv to TRUE > TRUE > [yohgaki@dev ~]$ php -r "var_dump((TRUE < 100));" > bool(false) Equiv to TRUE < TRUE > [yohgaki@dev ~]$ php -r "var_dump((TRUE > -100));" > bool(false) Equiv to TRUE > TRUE > [yohgaki@dev ~]$ php -r "var_dump((TRUE < -100));" > bool(false) Equiv to TRUE < TRUE > TRUE/FALSE only evaluated as 1/0 otherwise always return FALSE in > expression. You must stop phrasing it that way -- that may be accidentally correct for some situations but it is not "the rule." > [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. -- S.