Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75496 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43010 invoked from network); 14 Jul 2014 17:19:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jul 2014 17:19:57 -0000 Authentication-Results: pb1.pair.com header.from=kristopherwilson@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=kristopherwilson@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.172 as permitted sender) X-PHP-List-Original-Sender: kristopherwilson@gmail.com X-Host-Fingerprint: 209.85.213.172 mail-ig0-f172.google.com Received: from [209.85.213.172] ([209.85.213.172:64717] helo=mail-ig0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B5/EA-25444-C3114C35 for ; Mon, 14 Jul 2014 13:19:57 -0400 Received: by mail-ig0-f172.google.com with SMTP id h15so1968806igd.17 for ; Mon, 14 Jul 2014 10:19:54 -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=Vvw/A0S4omPcjfNIS0xpzdb2ZLz9blTa2eXV4+t1rHg=; b=PMPR8+n8+l5AR9xpqQurdOmThfoXBiNY8PQQVtfx9ALji/sggQ1yDAcmuBSZktKWBa yT+4aov8soERU6UxvklSfux3756nUi6LCzX96NPDXpXk7dPSYMUFOrgNH42LeFU2QTS+ dRBen8hB1s1CqPy/w2ogpklARTJrqy6zOifvfIVBXecbnB55pYMaPBXyHr1pb2oRspkv 32TSMd6DW6snFx1obUj4IQwKvRULXggA3SzSYlUlCzwmMtB3jpxGKagdy0IhCK4YXn/l 8zLlGUh47j5PHeqtYMR4IXVp5uqV+17yJNkjehPD7jEu+kxFRnQOtPDBezialY+HE6AC bocQ== MIME-Version: 1.0 X-Received: by 10.42.123.204 with SMTP id t12mr23103118icr.19.1405358394023; Mon, 14 Jul 2014 10:19:54 -0700 (PDT) Received: by 10.64.7.163 with HTTP; Mon, 14 Jul 2014 10:19:53 -0700 (PDT) In-Reply-To: <20140714171446.GG27743@phcomp.co.uk> References: <08503591-EFC8-48E6-984E-FFC292C5EA5F@ajf.me> <53C3F70A.7010706@gmail.com> <3aa29e080d70c843713e19a952dfbad6@mail.gmail.com> <20140714170149.GE27743@phcomp.co.uk> <20140714171446.GG27743@phcomp.co.uk> Date: Mon, 14 Jul 2014 13:19:53 -0400 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=20cf300e5383dba65e04fe2a7f17 Subject: Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening) From: kristopherwilson@gmail.com (Kristopher) --20cf300e5383dba65e04fe2a7f17 Content-Type: text/plain; charset=UTF-8 On Mon, Jul 14, 2014 at 1:14 PM, Alain Williams wrote: > On Mon, Jul 14, 2014 at 06:09:22PM +0100, Andrea Faulds wrote: > > > > On 14 Jul 2014, at 18:01, Alain Williams wrote: > > > > > But if you have: > > > > > > function foo(int $a) { > > > ... > > > $a = 3 / 2; > > > } > > > > > > What do you expect $a to contain ? I would suggest integer 1. > > > I would have expected 1 - since it appears, from the code, that $a should > only contain integers. What about the current type hinting we have, then? function foo(Bar $a) { $a = 3 / 2; } Perfectly OK. Why would we treat scalars any different? --20cf300e5383dba65e04fe2a7f17--