Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77176 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59673 invoked from network); 14 Sep 2014 09:16:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Sep 2014 09:16:15 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.47 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.216.47 mail-qa0-f47.google.com Received: from [209.85.216.47] ([209.85.216.47:38377] helo=mail-qa0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F5/B0-53483-EDC55145 for ; Sun, 14 Sep 2014 05:16:15 -0400 Received: by mail-qa0-f47.google.com with SMTP id dc16so2562492qab.20 for ; Sun, 14 Sep 2014 02:16:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=/WyEvP4kjBSaDFlcppVv0YL219BdHU3WiIuUdAUGpy4=; b=Jn8Pdz/cPYLIsomxqnKaFLjtVhFhTpBAJwxOVY3XBR8jwp27AUgbhJhTRnkl9P5/+h cf7sziX32Suap7wZOl8I/JVI4HRF9rB9IBLI3MkZmAPTa4ZnshD+dcEfKQOBKcXjXZQl 4tVwF5LpePmLcUYP1Un0kdZjWDWHSYXSzUzVvj9UuhYV+MKOVO43ZcTvQqcR7r0DqMrS xxrod/ltggaduowESEJhTlzqLNH2SCpQ53k26cZlubq2ZO0O7Byb1TySGL4IRufmCbZN WaA4ofYlOX+nHlY2I5Mx0uZo1bENfR00OLykfEB8JjKau9C2ygaFhHrVzoR2Pee6Pwm2 8Juw== MIME-Version: 1.0 X-Received: by 10.229.67.69 with SMTP id q5mr27042980qci.25.1410686172408; Sun, 14 Sep 2014 02:16:12 -0700 (PDT) Received: by 10.140.22.51 with HTTP; Sun, 14 Sep 2014 02:16:12 -0700 (PDT) In-Reply-To: <20140914091236.GC14312@phcomp.co.uk> References: <6893A97A-EC4C-4124-B804-96E2A26B953F@ajf.me> <20140914000718.GB14312@phcomp.co.uk> <3177B936-50C1-4E5D-8687-FD235C72B411@ajf.me> <20140914091236.GC14312@phcomp.co.uk> Date: Sun, 14 Sep 2014 11:16:12 +0200 Message-ID: To: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [VOTE][RFC] Scalar Type Hinting with Cast From: pierre.php@gmail.com (Pierre Joye) On Sun, Sep 14, 2014 at 11:12 AM, Alain Williams wrote: > On Sun, Sep 14, 2014 at 01:10:20AM +0100, Andrea Faulds wrote: >> >> On 14 Sep 2014, at 01:07, Alain Williams wrote: >> >> > You give an option for float to int casting to truncate. >> >> Where? > > Possible Changes > > Float to Int Casting Rules > > ... > > This could be relaxed for semi-representable values. So 1.5 could be allowed > for an int parameter (casted to 1). That's one thing I do not like much. If one accepts both int and float, numeric should be used instead. But allowing float for int and raises warnings on data losses is just awkward imho. -- Pierre @pierrejoye | http://www.libgd.org