Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70096 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68889 invoked from network); 10 Nov 2013 21:33:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Nov 2013 21:33:28 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.53 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.215.53 mail-la0-f53.google.com Received: from [209.85.215.53] ([209.85.215.53:61357] helo=mail-la0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 26/22-58055-6ABFF725 for ; Sun, 10 Nov 2013 16:33:27 -0500 Received: by mail-la0-f53.google.com with SMTP id eh20so3314847lab.26 for ; Sun, 10 Nov 2013 13:33:23 -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=XB1dOYYVUnX5lPnekvrh/753mEC+Ea3LwEd72YDvgSs=; b=EPYxxZbsi6yhGknjrLv8w7gwokKKZpVmBKwB2CFUMUXOSbm+KOIv2jmeSdG/SZnb7A eAgdaWOK53nWLVUYESFrh+C9sYFXvHFTld9lsd0O3fhiYoFLCdY8K55hIT7Fu9FDKi8a dAxksQcqe4YDFbTvHjGX3eJCY/7H89SoujMXxN/pX5Ziw6tMTPvfYvrIwe8niB22hn5Q LAB6cTDrRqVoREVeMdqPti+pZj4LFIdbMn+4ivvdD6ISetaHSLL5G6Vk8/80286df8mx FScymxZ8DKqUxJzcmjMztz5T/IsdihliyglbhLmKBynB65VVb8Nxe6XX8Yt9QWz4SdLO VCdA== X-Received: by 10.112.190.65 with SMTP id go1mr19479071lbc.16.1384119203856; Sun, 10 Nov 2013 13:33:23 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.154.201 with HTTP; Sun, 10 Nov 2013 13:32:43 -0800 (PST) In-Reply-To: <527FF7FD.7050700@sugarcrm.com> References: <527FF7FD.7050700@sugarcrm.com> Date: Mon, 11 Nov 2013 06:32:43 +0900 X-Google-Sender-Auth: knCWM9-sVMjqDejPSpCqnsQ-MYY Message-ID: To: Stas Malyshev Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11c34b7c79091b04ead95d5e Subject: Re: [PHP-DEV] Re: [RFC] Comparison and conversion inconsistency - need more info From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11c34b7c79091b04ead95d5e Content-Type: text/plain; charset=UTF-8 Hi Stas, On Mon, Nov 11, 2013 at 6:17 AM, Stas Malyshev wrote: > > TRUE always evaluated as 1. I guess I've checked this behavior and made > > wrong assumption > > FALSE/NULL is always evaluated as 0, but it's not. > > True is not evaluated as 1, 1 is evaluated as true. When you compare > with bool, other side is converted to bool. Which is described in the > manual :) Try the same with -17, you'd get the same result, since -17 is > bool-eanized as true. bool or null anything Convert to bool, FALSE < TRUE I was reading null gets converted to bool, but it's on both ops. It's surprising to me that I've never bitten by this misunderstanding :( Thank you for your time. -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11c34b7c79091b04ead95d5e--