Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78293 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66538 invoked from network); 24 Oct 2014 08:14:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Oct 2014 08:14:02 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.169 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.169 mail-wi0-f169.google.com Received: from [209.85.212.169] ([209.85.212.169:55149] helo=mail-wi0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A4/70-62277-84A0A445 for ; Fri, 24 Oct 2014 04:14:00 -0400 Received: by mail-wi0-f169.google.com with SMTP id q5so586169wiv.0 for ; Fri, 24 Oct 2014 01:13:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type:subject:from:date:to :message-id; bh=J6j8si5hExzBXPsoS0ld/FU3oXAdy+aRE4aAi4gRKjs=; b=NxEv9Lzt5SRFfaZW0SE9oELZswq1JuBpEcFfYDsjbibMoSxtGWVNSIzccV8pONFMkz 4rk6DBPbCFpknDOaAVziciLH32blwQ2F6YXAzhUCv9SsgjsNxxSw+uOmd96/C9EYwvx5 eoQEhr+xshH5rMRj6hElMfKtpxUKfsKFUnaw/YaaFYSE2OmXygiV5gjaTS6WyrtHHVw1 FEfSO/rUSqSM+8GPPJC6UztlvkA7cJ4yuGvPoQl4hmmJqw7E2m1xZNSBE/kdJrIyLu5D knwm387PK8pjGrSBzmtdR15qVgMGh2E1wwxAt7LjZ+OziQIH2DuxBz4RIFSYHY9KPunG An6Q== X-Received: by 10.181.27.135 with SMTP id jg7mr2432707wid.56.1414138437433; Fri, 24 Oct 2014 01:13:57 -0700 (PDT) Received: from [192.168.0.3] (cpc68956-brig15-2-0-cust215.3-3.cable.virginm.net. [82.6.24.216]) by mx.google.com with ESMTPSA id cw6sm4768059wjb.18.2014.10.24.01.13.55 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 24 Oct 2014 01:13:56 -0700 (PDT) User-Agent: K-9 Mail for Android In-Reply-To: <6E04B9BE-854E-4112-8C74-7D90BD8BFE95@ajf.me> References: <6E04B9BE-854E-4112-8C74-7D90BD8BFE95@ajf.me> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Date: Fri, 24 Oct 2014 09:12:52 +0100 To: PHP Internals Message-ID: <585248B1-5907-4A32-ACFC-0CDD7F1B2009@gmail.com> Subject: Re: [PHP-DEV] [RFC] Readonly Properties From: rowan.collins@gmail.com (Rowan Collins) On 24 October 2014 00:36:35 GMT+01:00, Andrea Faulds wrote: >Good evening once again, > >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. > >Since I am a big proponent of including specification patches in new >RFCs, I have decided to put my money (or rather, time) where my mouth >is and I have actually written a specification patch before writing an >RFC. I would love to see this become the new standard for RFCs >affecting the language. > >If you are curious at all about the behaviour, I suggest perusing the >fairly comprehensive set of twelve tests included in the main patch to >php-src. > >Thanks! >-- >Andrea Faulds >http://ajf.me/ If nothing else, I like that this brings userland objects another step closer to those defined in extensions, which frequently use readonly properties. I note that UString advertises a ->length rather than a ->getLength, and I haven't seen anyone in that thread object to that design decision, so I don't really buy the "you should never need this" argument. The additional keyword and potential performance impact are more concerning, and will need to be weighed carefully against the benefits.