Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78318 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86485 invoked from network); 24 Oct 2014 23:34:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Oct 2014 23:34:08 -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 108.166.43.123 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 108.166.43.123 smtp123.ord1c.emailsrvr.com Linux 2.6 Received: from [108.166.43.123] ([108.166.43.123:38257] helo=smtp123.ord1c.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C8/82-06869-EE1EA445 for ; Fri, 24 Oct 2014 19:34:06 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp16.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id 0618918032E; Fri, 24 Oct 2014 19:34:04 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp16.relay.ord1c.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id B2F5218014E; Fri, 24 Oct 2014 19:34:03 -0400 (EDT) X-Sender-Id: smalyshev@sugarcrm.com Received: from Stass-MacBook-Pro.local ([UNAVAILABLE]. [74.85.23.222]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA) by 0.0.0.0:465 (trex/5.3.2); Fri, 24 Oct 2014 23:34:03 GMT Message-ID: <544AE1EB.9060908@sugarcrm.com> Date: Fri, 24 Oct 2014 16:34:03 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Andrea Faulds , PHP Internals References: <6E04B9BE-854E-4112-8C74-7D90BD8BFE95@ajf.me> In-Reply-To: <6E04B9BE-854E-4112-8C74-7D90BD8BFE95@ajf.me> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] Readonly Properties From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > Here’s another RFC: https://wiki.php.net/rfc/readonly_properties > > It proposes, with a working implementation, a modifier for properties that makes them readable and writeable from different scopes. For me, this seems both too big and too small. Too small, because if you really it assigns a keyword to special use case of a generic feature, and thus I think does not lead us on the right path - we could not assign keywords to every behavior of properties, so either we forever reject the idea of having any generic solution there, or we'd eventually have two solutions, working in two different ways. Too big because this particular case is already very easy to implement by just making the property protected and having a public getter. It doesn't add any capability that we already don't have, and having a keyword just to save typing () seems unnecessary to me (performance is really irrelevant here, if your performance is bound by speed of accessors, you should be writing that code in C). Also, the name "readonly" appears misleading as it's not really read only - it's only read only for some classes, but writeable for others. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/