Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80455 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 69653 invoked from network); 14 Jan 2015 10:22:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jan 2015 10:22:34 -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:50401] helo=imap1-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 18/B1-61073-96346B45 for ; Wed, 14 Jan 2015 05:22:33 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id E0ACFB00087; Wed, 14 Jan 2015 05:22:30 -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 nOoCFmvsPLBq; Wed, 14 Jan 2015 05:22:30 -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 DB072B0007B; Wed, 14 Jan 2015 05:22:29 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) In-Reply-To: Date: Wed, 14 Jan 2015 10:22:27 +0000 Cc: PHP Internals List Content-Transfer-Encoding: quoted-printable Message-ID: <76F9DAD3-5A22-4A53-8262-CF6B33D80FC3@ajf.me> References: <8DCD1B72-C81D-499E-B455-E4A042CD76E6@ajf.me> To: Julien Pauli X-Mailer: Apple Mail (2.1993) Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2 From: ajf@ajf.me (Andrea Faulds) Hi Julien, > On 14 Jan 2015, at 10:14, Julien Pauli wrote: >=20 > Using declare() IMO, is a PITA. > Everything that can be done without the use of declare(), must be done = without declare(). >=20 > I would have prefered different syntax, like the ones we disccussed = many years ago , having strict checks with the foo(string $a) syntax, = and non-strict check with the foo((string) $a) syntax. Actually, this approach came about mostly to avoid that. I don=E2=80=99t = really like the idea of mixing and matching weak and strict type checks. = Having some functions using (int) and (string), others use int and = string, and others still use both, would be confusing. Plus, it would = mean that you=E2=80=99d be forced to follow the personal preference of = the API authors. With this RFC, yes, you have to put an extra line at the top of the = file. But it has the advantage that everything follows the same = behaviour, even extension/built-in functions. That=E2=80=99s what I like = about it. -- Andrea Faulds http://ajf.me/