Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81603 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61701 invoked from network); 2 Feb 2015 16:39:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Feb 2015 16:39:10 -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.208 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.208 imap2-3.ox.privateemail.com Received: from [192.64.116.208] ([192.64.116.208:36890] helo=imap2-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 29/85-34915-D28AFC45 for ; Mon, 02 Feb 2015 11:39:10 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 66CAA8C007D; Mon, 2 Feb 2015 11:39:07 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap2.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap2.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id bTuZ6WJqMKAQ; Mon, 2 Feb 2015 11:39:07 -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 BAD368C0057; Mon, 2 Feb 2015 11:39:05 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) In-Reply-To: Date: Mon, 2 Feb 2015 16:39:03 +0000 Cc: Dmitry Stogov , PHP Internals List Content-Transfer-Encoding: quoted-printable Message-ID: <6C58B302-C78A-490B-A333-4D1A71334E19@ajf.me> References: <8DCD1B72-C81D-499E-B455-E4A042CD76E6@ajf.me> To: Derick Rethans X-Mailer: Apple Mail (2.2070.6) Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2 From: ajf@ajf.me (Andrea Faulds) Hey Derick, > On 2 Feb 2015, at 16:35, Derick Rethans wrote: >=20 > On Mon, 2 Feb 2015, Dmitry Stogov wrote: >=20 >> As I already told, in my opinion, version 0.1 was the perfect = solution that >> fit into PHP semantic very well. >>=20 >> declare(strict_types=3D1); - is really weird solution. >> It changes type hinting behavior per file scope, so, just to try = strict >> type hinting in a big project, people will have to change every = single PHP >> file. >=20 > THis is why I believe it makes more sense to have this switch on the=20= > callee side, instead of on the calling side. That does have its advantages. But it also has some quite severe = problems. For starters, if you set that flag on the callee side, you just broke = everything that uses that function and passes the =E2=80=9Cwrong=E2=80=9D = type. That=E2=80=99s a migration headache. It also means that you don=E2=80=99t have any choice over strictness as = the user of an API: some APIs are strict, others weak. That means three = lines of code might use three different approaches argument strictness. = I don=E2=80=99t like that terribly much. Thanks. -- Andrea Faulds http://ajf.me/