Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60311 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15569 invoked from network); 25 Apr 2012 06:52:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Apr 2012 06:52:33 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.163 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.163 smtp163.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.163] ([67.192.241.163:41696] helo=smtp163.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3A/9A-54790-13F979F4 for ; Wed, 25 Apr 2012 02:52:33 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp26.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id BC211801F9; Wed, 25 Apr 2012 02:52:30 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp26.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 3BDCB801BF; Wed, 25 Apr 2012 02:52:30 -0400 (EDT) Message-ID: <4F979F2D.805@sugarcrm.com> Date: Tue, 24 Apr 2012 23:52:29 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 To: Clint Priest CC: Benjamin Eberlei , "internals@lists.php.net" References: <9570D903A3BECE4092E924C2985CE48555BEC3C2@MBX202.domain.local> <4F96DE96.7020006@sugarcrm.com> <9570D903A3BECE4092E924C2985CE48555BECE83@MBX202.domain.local> In-Reply-To: <9570D903A3BECE4092E924C2985CE48555BECE83@MBX202.domain.local> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] RFC: Property get/set syntax (added isset/unset and references) From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! >> - Variables may be used as input to out/ref arguments. Properties >> may not. This will probably be true for properties too, in some cases. However, it is in no way an advantage. >> - Properties may throw exceptions - variables will never do that. In PHP, properties can not throw exceptions unless your code does, and variable access can throw exceptions too if you do that in __get. >> - Properties may have side effects or take a really long time to >> execute. Variables have no side effects and will always be as fast >> as can be expected for the given type. Again, depends on __get. >> - Properties support different accessibility - variables do not In PHP, variables have access modifiers. >> - When using reflection the properties and fields are treated as >> different MemberTypes so are located differently (GetFields vs >> GetProperties for > example) It may be so, but I don't see where there's an advantage. So, none of these explain why would one want to create "default implementation" property. Could you explain? > Some of these above example still apply (reflection, execution time), > so the automatic implementations may simply be there as a way for > authors to indicate their intention to make them execute code at a > later time. If they would want to make them execute code at a later time, they could convert them to properties then. I think the whole point of introducing properties is that they would work transparently for the client, so if we saying we'd have to pre-define them as properties that defeats the whole purpose of it. I think as proposed "default implementation" only makes it more confusing as it works differently from user-space implementations. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227