Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63649 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42275 invoked from network); 26 Oct 2012 14:39:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Oct 2012 14:39:58 -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.131 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.131 smtp131.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.131] ([67.192.241.131:45406] helo=smtp131.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 97/B6-00401-DB0AA805 for ; Fri, 26 Oct 2012 10:39:57 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp29.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id BF40B398631; Fri, 26 Oct 2012 10:39:54 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp29.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 38535398539; Fri, 26 Oct 2012 10:39:54 -0400 (EDT) Message-ID: <508AA0B8.8090308@sugarcrm.com> Date: Fri, 26 Oct 2012 16:39:52 +0200 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Clint Priest CC: PHP Developers Mailing List References: <508A695F.8080308@zerocue.com> In-Reply-To: <508A695F.8080308@zerocue.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Property Accessors v1.2 : Extra shorthand declaration From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > /* Would be equivalent to this */ > > class TimePeriod { > public $date { > get() { return $this->date; } > set(DateTime $value) { $this->date = $value;} > } > } I don't think this has a use case and this encourages mixing variables with properties (which I'm not sure is a very good idea) and writing slower and more complicated code which doesn't actually do any additional work. I'd rather not encourage it. If you want it - fine, implement it, but I don't think supporting it is good. Also, "get() { return $this->date; }" implies there is a thing called "$this->date" which is not the property itself. So what is it? Should there be additional "public $date;" declaration in your code? Is it implied that property definition also creates a variable inside class automatically - I was under expression this does not happen, and nothing in the RFC implies it. Should it be $this->__date maybe like in "automatic accessors" part of the RFC? -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227