Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84758 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97721 invoked from network); 14 Mar 2015 04:31:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Mar 2015 04:31:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.54 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.218.54 mail-oi0-f54.google.com Received: from [209.85.218.54] ([209.85.218.54:33127] helo=mail-oi0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9C/50-34457-789B3055 for ; Fri, 13 Mar 2015 23:31:03 -0500 Received: by oibu204 with SMTP id u204so2385419oib.0 for ; Fri, 13 Mar 2015 21:31:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=F4xOgnupPEDusn3hhPcdekuoutFmaXjqNUSd/EaMbIo=; b=uBDSrktqcS+/em72CpvCC6StwSyhx21Hb6zRrK/GpKiCyNtZ7mHuvfFm3FZC8OEOao UemAsNA6ThEsQc0fxWcevAh0DxFsmTr5A+AS05n5ecG5xB0hV1XmwZg9muueumoGFTwX VojARf2CVDJThTr7ZLXpl6FXgINIhjPCiHvkturgnrIPBkctcqBwDdvnEsTWdYvdkzeC dU3gU/feCmA8aEgLctl0Wo0NRi3MZHIUJZbZq4KgvwfLdH6aWqEtsiVwcDRVeH2Kes/W zaWVPzfE+apctjVJ8RaZE22ZMS2kqS9VDgiI7mKytCiU7B7+EmORvmTC2U5CmVGUmhht DdjA== MIME-Version: 1.0 X-Received: by 10.182.199.70 with SMTP id ji6mr40202842obc.3.1426307460815; Fri, 13 Mar 2015 21:31:00 -0700 (PDT) Sender: morrison.levi@gmail.com Received: by 10.76.90.74 with HTTP; Fri, 13 Mar 2015 21:31:00 -0700 (PDT) In-Reply-To: <46F3AD65-6689-4E75-836C-968608F7D30D@lerdorf.com> References: <46F3AD65-6689-4E75-836C-968608F7D30D@lerdorf.com> Date: Fri, 13 Mar 2015 22:31:00 -0600 X-Google-Sender-Auth: E1oiPuwpm8rfEp_KXaJXnihih7I Message-ID: To: Rasmus Lerdorf Cc: Zeev Suraski , Dmitry Stogov , "francois@php.net" , PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [VOTE][RFC] Coercive Scalar Type Hints From: levim@php.net (Levi Morrison) On Fri, Mar 13, 2015 at 8:50 PM, Rasmus Lerdorf wrote: > On Mar 14, 2015, at 13:37, Levi Morrison wrote: >> It seems that `float -> bool` is always disallowed. If I am correct >> `int -> bool` is permitted for all values (not just 0 and 1), which >> means that floats which can be converted to integers without dataloss >> should also be permitted to be booleans. If a specific float can be >> converted to an int, and all ints can be converted to booleans, then >> the transitive property should hold for that float to a bool. > > The problem there is what does "without dataloss" mean? At which precision do you consider there to be no dataloss? Ah, I reread part of the RFC. It appears `float -> int` is unchanged from current. This only confuses me more, though. If int -> float is permitted, and float -> int is permitted, I do not understand why float -> bool is not permitted. Can someone clarify this?