Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80502 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75949 invoked from network); 14 Jan 2015 22:42:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jan 2015 22:42:23 -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.216 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.216 imap10-3.ox.privateemail.com Received: from [192.64.116.216] ([192.64.116.216:58517] helo=imap10-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D8/02-00659-EC0F6B45 for ; Wed, 14 Jan 2015 17:42:22 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id EDFE02400D3; Wed, 14 Jan 2015 17:42:19 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap10.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap10.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Xn-MKv8RORMR; Wed, 14 Jan 2015 17:42:19 -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 39AB12400D7; Wed, 14 Jan 2015 17:42:18 -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 22:42:16 +0000 Cc: PHP Internals List Content-Transfer-Encoding: quoted-printable Message-ID: <7B5C883B-E8FE-489A-B1E2-EAD6722544C8@ajf.me> References: <8DCD1B72-C81D-499E-B455-E4A042CD76E6@ajf.me> To: Dmitry Stogov X-Mailer: Apple Mail (2.1993) Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2 From: ajf@ajf.me (Andrea Faulds) Hey Dmitry, > On 14 Jan 2015, at 20:40, Dmitry Stogov wrote: >=20 > In my opinion, version 0.1 was consistent enough. >=20 > handling two different approaches just makes mess... >=20 > We have internal function strlen(string $s), and it may be called with = integer argument e.g. strlen(123) -> 3 > I think user functions should follow the same rules. This RFC does that. In the =E2=80=9Cweak=E2=80=9D mode that would = continue work, and it would also for userland functions with scalar type = hints. In the =E2=80=9Cstrict=E2=80=9D mode that would break, and it = would also break for a similar userland function with a scalar type = hint. >=20 > If some rules are "bad", lets change that rules for both internal and = user functions. > But it's better to do it in a separate RFC (after scalar type hinting = 0.1 accepted), or we will stick forever. I=E2=80=99m not sure the weak typing approach to function parameters is = bad per se, but a lot of developers would certainly prefer the strict = typing approach. That=E2=80=99s why the RFC allows choice: for all the = people that weak typing works for, good, you can keep using that. The = people who want strict typing get strict typing without forcing the = people who want weak typing to use it. Thanks. -- Andrea Faulds http://ajf.me/