Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80065 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63020 invoked from network); 1 Jan 2015 17:23:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Jan 2015 17:23:55 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; 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:56601] helo=imap1-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C1/51-60454-9A285A45 for ; Thu, 01 Jan 2015 12:23:54 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 8422BB00068; Thu, 1 Jan 2015 12:23:50 -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 OxtuytT9BVjS; Thu, 1 Jan 2015 12:23:50 -0500 (EST) Received: from [192.168.0.13] (unknown [94.13.96.117]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id C66C9B00058; Thu, 1 Jan 2015 12:23:48 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) In-Reply-To: Date: Thu, 1 Jan 2015 17:23:16 +0000 Cc: Thomas Bley , Nikita Popov , internals Content-Transfer-Encoding: quoted-printable Message-ID: <84D69842-83F0-4E98-AF54-6BD51E0D2929@ajf.me> References: <41D5BB0B-73AF-488E-968D-90B2878E3178@ajf.me> <20150101164402.EB1442605AB@dd15934.kasserver.com> To: Levi Morrison X-Mailer: Apple Mail (2.1993) Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints From: ajf@ajf.me (Andrea Faulds) Hey Levi, > On 1 Jan 2015, at 17:19, Levi Morrison wrote: >=20 > On Thu, Jan 1, 2015 at 9:44 AM, Thomas Bley = wrote: >> I think it is no problem to add strict parameter type hints with = another rfc (if this rfc gets accepted), e.g. function foobar(string! = $str, int! $str){} or any other syntax. >>=20 >=20 > I would rather have it the other way around. `string $str` is strict > and some other syntax (notably `(string) $str` or `@string $str`) can > be loose. Rather than having it on a function-by-function basis, meaning different = APIs would have different rules, I am warming to the idea of having a = per-file strict mode. That is, if you used something like =E2=80=9Cuse = strict;=E2=80=9D at the top of your code, functions you called would = have strict parameter type checking. But if you didn=E2=80=99t, they=E2=80= =99d be loose. This way all APIs would be consistent, but you=E2=80=99d = have the choice of strictness or non-strictness as you see fit. This would be similar to Hack=E2=80=99s Strict and Decl modes. I=E2=80=99m not necessarily saying it=E2=80=99s the best idea, but = it=E2=80=99s certainly an option. The syntax is already reserved! ;) Thanks. -- Andrea Faulds http://ajf.me/