Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77184 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20022 invoked from network); 14 Sep 2014 15:47:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Sep 2014 15:47:57 -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 198.187.29.245 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 198.187.29.245 imap11-3.ox.privateemail.com Received: from [198.187.29.245] ([198.187.29.245:57797] helo=imap11-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 41/0A-53483-BA8B5145 for ; Sun, 14 Sep 2014 11:47:55 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 605D28800E6; Sun, 14 Sep 2014 11:47:52 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap11.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap11.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Wxy7KXEKxWxa; Sun, 14 Sep 2014 11:47:52 -0400 (EDT) Received: from oa-res-27-90.wireless.abdn.ac.uk (oa-res-27-90.wireless.abdn.ac.uk [137.50.27.90]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 01B9D8800EC; Sun, 14 Sep 2014 11:47:49 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: Date: Sun, 14 Sep 2014 16:47:46 +0100 Cc: Zeev Suraski , Stas Malyshev , "internals@lists.php.net" Content-Transfer-Encoding: quoted-printable Message-ID: <6E402FE8-119A-4BBB-B652-97A0DBEC8BC9@ajf.me> References: <6893A97A-EC4C-4124-B804-96E2A26B953F@ajf.me> <20140914000718.GB14312@phcomp.co.uk> <3177B936-50C1-4E5D-8687-FD235C72B411@ajf.me> <54153692.7050500@sugarcrm.com> <9CE963B0-E624-4267-BC2A-0F8D1F985DAE@ajf.me> <6f2236e18c61d30b247e1c6bb2de10f1@mail.gmail.com> <8556C1E7-EDF3-47E2-9DA0-C9AB63DE56E6@ajf.me> To: Andrey Andreev X-Mailer: Apple Mail (2.1878.6) Subject: Re: [PHP-DEV] [VOTE][RFC] Scalar Type Hinting with Cast From: ajf@ajf.me (Andrea Faulds) On 14 Sep 2014, at 16:40, Andrey Andreev wrote: > ... and I responded to this in the next paragraph. Userland doesn't > case about internal differences, that's why they're called internal > and why people outside of php-internals have for so long been puzzled > why we only have array and object type hints. "Internal functions=94 refers to functions from extensions. It has no = relation to internal*s*, the mailing list. > That's exactly what I'm talking about ... we already have a syntax for > strict typing, (and I want to put an emphais on this) *regardless of > the reasons why, we do have strict type hints*. I don't understand why > everybody is pretending that PHP doesn't have that feature just > because we're talking about scalars here. Nobody=92s arguing we don=92t already have strict type hints. I=92m = arguing strict hints don=92t make sense for scalars. Note that we = document strict (array, object) parameter types and non-strict (scalar) = parameter types in the same way in our documentation. > Speaking strictly from a userland perspective, using that same syntax > for something different will be inconsistent and will cause confusion. > That another syntax could be used for strict typing in the future is > just not a serious thing to say. Why is it "not a serious thing to say=94? I don=92t understand. > You can't say it's the worst of both worlds when you have both worlds > in their entirety. No, you can. Allowing both options can be =93the worst of both worlds=94. = This is just a trivial matter of semantics, though. > And most importantly, they have always been two > separate worlds because they just don't make sense otherwise. Have they? We already mix strict and non-strict typing in PHP. Functions = taking objects, internal or not, will error if you pass the wrong type = of object. Internal functions taking scalars will not error and instead = cast, at least most of the time. -- Andrea Faulds http://ajf.me/