Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80074 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90610 invoked from network); 2 Jan 2015 00:18:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Jan 2015 00:18:44 -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:36905] helo=imap1-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 62/61-18015-3E3E5A45 for ; Thu, 01 Jan 2015 19:18:43 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id CDDD1B0008A; Thu, 1 Jan 2015 19:18:39 -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 2-4bq-BInohW; Thu, 1 Jan 2015 19:18:39 -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 C6393B00068; Thu, 1 Jan 2015 19:18:38 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) In-Reply-To: <54A5DF14.7000105@gmail.com> Date: Fri, 2 Jan 2015 00:18:06 +0000 Cc: Nikita Popov , PHP Internals Content-Transfer-Encoding: quoted-printable Message-ID: <1F9664FA-07A3-4B15-9A11-C80FA16FDF35@ajf.me> References: <41D5BB0B-73AF-488E-968D-90B2878E3178@ajf.me> <54A5DF14.7000105@gmail.com> To: Stanislav Malyshev X-Mailer: Apple Mail (2.1993) Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints From: ajf@ajf.me (Andrea Faulds) > On 1 Jan 2015, at 23:58, Stanislav Malyshev = wrote: >=20 >> ability to check correct usage with tooling. I'd also like to point = out >> that Hack uses a strict type scheme and it seems to work well there = (though >=20 > Java uses strict typing too. And Perl has no typing whatsoever. So = what? > How bringing an example of one language that does what you want is an > argument for PHP to do that? There are examples of languages doing > practically anything imaginable. To add to what Stas says: C, in fact, has weak parameter typing. A = function taking a long long can be passed a char, or a double, or even a = pointer. Now, there=E2=80=99s a good case to be made that C=E2=80=99s = weak parameter typing is bad. But that=E2=80=99s mostly because C will = let you shoot yourself in the foot and overflow bounds, corrupt memory = or cause a segfault. PHP doesn=E2=80=99t have these issues though, so = that argument doesn=E2=80=99t really apply. By the way, =E2=80=9Cweak parameter typing=E2=80=9D sounds like a good = name for this. Makes more sense than =E2=80=9Cnon-strict=E2=80=9D or = =E2=80=9Ccasting=E2=80=9D. -- Andrea Faulds http://ajf.me/