Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80136 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36888 invoked from network); 4 Jan 2015 03:43:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jan 2015 03:43:29 -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.42 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.216.42 mail-qa0-f42.google.com Received: from [209.85.216.42] ([209.85.216.42:35876] helo=mail-qa0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C2/11-31232-0E6B8A45 for ; Sat, 03 Jan 2015 22:43:28 -0500 Received: by mail-qa0-f42.google.com with SMTP id n8so14119457qaq.29 for ; Sat, 03 Jan 2015 19:43:25 -0800 (PST) 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 :cc:content-type; bh=wX7Tkiu4iOI9AwSUa3WRYztojppjZgl/9aaG3850Gso=; b=flQKHOXBM0ux5JLwiRW2cZrYlKDMF5oNVcLM6XkOZXs4m9/NfK40swQQg7FTXpeq3a 9olKxiZqcs0J06NoQvL6+7MNsFpe1sKj19qz0EG4RC8YbXTPipRNnGLxq51eWz5F3Lt+ QioVjXlamvANObSz/scq5aBxALFdpK46C8eMlhGdn7KCh99Z7F0oUqX1AStp1EFV2LyU 0bEzWQw8wAPWrxSOKh+EL2n6xdXRLc5kAAfCMjfMT1AalQYG8Q3fpDN7guXsJnDNOqBg bsOydlbG79L0HJLo8LKCBUhoHfqHrQG+x3Rj49r4bGxZ7XN736aBbPZayQc3gBu1LOIC aPLw== MIME-Version: 1.0 X-Received: by 10.140.32.166 with SMTP id h35mr125660296qgh.22.1420343005456; Sat, 03 Jan 2015 19:43:25 -0800 (PST) Received: by 10.140.22.106 with HTTP; Sat, 3 Jan 2015 19:43:25 -0800 (PST) Received: by 10.140.22.106 with HTTP; Sat, 3 Jan 2015 19:43:25 -0800 (PST) In-Reply-To: <93B11897-3B8E-4D71-A8EB-A2D67B5446E9@ajf.me> References: <41D5BB0B-73AF-488E-968D-90B2878E3178@ajf.me> <360F9366-07C2-4C7A-AC3C-D482AFDD9838@ajf.me> <93B11897-3B8E-4D71-A8EB-A2D67B5446E9@ajf.me> Date: Sat, 3 Jan 2015 19:43:25 -0800 Message-ID: To: Andrea Faulds Cc: PHP internals , "Sebastian B.-Hagensen" Content-Type: multipart/alternative; boundary=001a11397ec04caefd050bcb609b Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints From: pierre.php@gmail.com (Pierre Joye) --001a11397ec04caefd050bcb609b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, On Jan 4, 2015 3:10 AM, "Andrea Faulds" wrote: > > Hi Sebastian, > > > On 3 Jan 2015, at 19:46, Sebastian B.-Hagensen wrote: > >> > >> Yeah, I don=E2=80=99t like this behaviour much. I want to avoid incons= istency with the behaviour of extension functions (i.e. zend_parse_parameters) where possible, though. Since this has come up so much, I should probably make an RFC to change this aspect of ZPP=E2=80=99s behaviour. > > > > That RFC should probably be voted on before this RFC proceeds into voting. > > That would be the idea. > > > After skimming through the RFC I'm unsure what the following code would produce: > > > > function test(int $a, int $b) {} > > > > test("10.4", 10.6); > > > > If a warning/notice is raised, fine. If it will just result in $a =3D= =3D=3D > > (int)10 && $b =3D=3D=3D(int)10 : > > The first argument would be converted to 10 and a notice (=E2=80=9CNon we= ll formed numeric string=E2=80=9D). The second would also be converted to 10, = but silently. Hm. It sounds bad. There is a data loss, a notice must be raised. This is exactly the kind of magic conversion that should not happen for arguments. > I agree with your sentiments about data loss, but I am reluctant to deviate much from the behaviour of internal functions to avoid the inconsistency that plagued the previous RFC. Right, but this is what I would expect. Am I the only one? --001a11397ec04caefd050bcb609b--