Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81595 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50169 invoked from network); 2 Feb 2015 16:17:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Feb 2015 16:17:26 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.200 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.200 imap1-2.ox.privateemail.com Received: from [192.64.116.200] ([192.64.116.200:37566] helo=imap1-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E2/F2-34915-413AFC45 for ; Mon, 02 Feb 2015 11:17:26 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 2B7EDB00091; Mon, 2 Feb 2015 11:17:22 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap1.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap1.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id qz8I0sMUHWxh; Mon, 2 Feb 2015 11:17:22 -0500 (EST) Received: from oa-res-26-240.wireless.abdn.ac.uk (oa-res-26-240.wireless.abdn.ac.uk [137.50.26.240]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 658F7B00085; Mon, 2 Feb 2015 11:17:21 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) In-Reply-To: <54CF88BD.7050405@fischer.name> Date: Mon, 2 Feb 2015 16:17:19 +0000 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: <05215ABA-DB9D-4C0A-BAAA-938FF6B0EFAB@ajf.me> References: <8DCD1B72-C81D-499E-B455-E4A042CD76E6@ajf.me> <54CF88BD.7050405@fischer.name> To: Markus Fischer X-Mailer: Apple Mail (2.2070.6) Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2 From: ajf@ajf.me (Andrea Faulds) Hi Markus, > On 2 Feb 2015, at 14:25, Markus Fischer wrote: >=20 > - Since consensus on the strict mode does part the community (or, the > greater community also outside @internals) my impression is that the > current best way to move forward would be >=20 > - get the rfc to only go for weak types for now > - using the "cast-like syntax": function foo( (int) $bar ); >=20 > and ultimately keep the strict type out for /now/ and try it at a = later > time, the "function foo( int $bar )"-syntax. I=E2=80=99m not sure that really works that well. It=E2=80=99s not a = terribly good compromise: If you want strict typing, you not only = haven=E2=80=99t got it, but even worse, you=E2=80=99ll be forced to deal = with weak typing if you use the wrong library, because the (int) syntax = would be specifically for weak types. It=E2=80=99s not really a = compromise at all, actually. > I'm actually not really in favor of just weak types, I would consider > myself a "strict type" voter, but through the community communication > here I saw a) the benefits of weak types hinting/casting b) without > getting in the way of a possible future strict type (e.g. with the > "non-cast-like syntax=E2=80=9D). Well this RFC tries to strike a different balance: rather than having = the chaos of some functions using weak types, others strict types, = others both, it just adds scalar types and lets you choose the behaviour = that suits you. It means weak typing fans can live in their weakly-typed = world, and strict typing fans can live in their strictly-typed world. = That=E2=80=99s the idea, anyway. But I=E2=80=99m just going in circles at this point. :P Thanks for your contributions. -- Andrea Faulds http://ajf.me/