Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63454 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36951 invoked from network); 16 Oct 2012 10:55:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Oct 2012 10:55:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 207.97.245.193 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 207.97.245.193 smtp193.iad.emailsrvr.com Linux 2.6 Received: from [207.97.245.193] ([207.97.245.193:40192] helo=smtp193.iad.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 46/4C-10021-03D3D705 for ; Tue, 16 Oct 2012 06:55:44 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp59.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id 2D8833F0544; Tue, 16 Oct 2012 06:55:42 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp59.relay.iad1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id EA8563F0551; Tue, 16 Oct 2012 06:55:38 -0400 (EDT) Message-ID: <507D3D29.9070709@sugarcrm.com> Date: Tue, 16 Oct 2012 13:55:37 +0300 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Amaury Bouchard CC: Levi Morrison , Clint Priest , "internals@lists.php.net" , "Nikita Popov (nikita.ppv@gmail.com)" References: <9570D903A3BECE4092E924C2985CE485612B6434@MBX202.domain.local> <507D133A.4040701@sugarcrm.com> <507D2FB3.3030806@sugarcrm.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [PHP-DEV [RFC] Property Accessors v1.2 : Typehints / Accessor Syntax From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > If the first could be useful, the second could be useful too. Or you are > saying that parameters type hinting was a bad idea? Given how it is understood now - as a first step to make PHP a strongly typed language - yes, I'm starting to think it was. If it was understood as it was intended - as a small hack to catch obvious code failures - then it'd be OK (not that great, but fine) idea, but given that more and more people misunderstand it as declaration of intent for PHP to be strongly typed language - I think maybe we would be better off not doing that after all. > Last thing: I agree with Clint and you. If it was early checked, it > would be better. But the current type hinting is far better than nothing > at all. Yes, we can't "lint" it, but it was pretty useful a big number No, it's not better. Having code that can randomly fail with one error message is not better than having code that can randomly fail with another error message. It is more or less the same. It can actually be worse since it'd introduce more boliterplate checks in wrong places (i.e., you'd have to check every variable for correct type before assigning it to typed property) and does not provide any control over how the situation when something is wrong is going to be handled. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227