Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64511 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22755 invoked from network); 3 Jan 2013 22:43:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jan 2013 22:43:39 -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:49925] helo=smtp163.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 46/F4-00128-99906E05 for ; Thu, 03 Jan 2013 17:43:38 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp6.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 25292270222; Thu, 3 Jan 2013 17:43:35 -0500 (EST) X-Virus-Scanned: OK Received: by smtp6.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id BCFA6270283; Thu, 3 Jan 2013 17:43:33 -0500 (EST) Message-ID: <50E60994.4000400@sugarcrm.com> Date: Thu, 03 Jan 2013 14:43:32 -0800 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Steve Clay CC: "internals@lists.php.net" References: <50E41BB6.4030901@zerocue.com> <50E4A43E.6030302@zerocue.com> <50E4B232.5000505@mrclay.org> <50E4BDDE.8050509@zerocue.com> <50E4D0BB.7060701@mrclay.org> <50E4FA09.7030001@zerocue.com> <50E529B6.1050903@sugarcrm.com> <50E593DF.9090004@mrclay.org> In-Reply-To: <50E593DF.9090004@mrclay.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [PHP-RFC] Property Accessors 1.2 for Final Review before Vote From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > I think infinite recursion is a potential issue for lots of logging setups ("let's log > when someone calls the logger!") and situations where you have multiple values to keep in > sync. The accessor implementation shouldn't try to solve these design problems. The whole problem here is that the only reason why it is a problem is because of the accessors that have hidden state in guards. If it were regular variables (and for all the API consumer knows, they are) there wouldn't be any question about if we're allowed to read $user->username or not - if it's public, of course we can read it. So the problem exists because the hidden state exists. It's not the problem of the code that uses public APIs in completely legal way, it is the problem of our implementation that we have hidden state that changes how variable access works. With __get we mostly ignored it since recursion blocker leads to the same result as if the variable did not exist - which is the case for __get anyway, kind of - so it was less explicit. With accessors it may become more painful. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227