Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78294 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68632 invoked from network); 24 Oct 2014 08:35:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Oct 2014 08:35:15 -0000 Authentication-Results: pb1.pair.com header.from=narf@devilix.net; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=narf@devilix.net; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain devilix.net designates 209.85.213.42 as permitted sender) X-PHP-List-Original-Sender: narf@devilix.net X-Host-Fingerprint: 209.85.213.42 mail-yh0-f42.google.com Received: from [209.85.213.42] ([209.85.213.42:58908] helo=mail-yh0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 50/D0-62277-04F0A445 for ; Fri, 24 Oct 2014 04:35:13 -0400 Received: by mail-yh0-f42.google.com with SMTP id t59so3553214yho.15 for ; Fri, 24 Oct 2014 01:35:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=devilix.net; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=B5sG/rsuidPMbavFqqak+Ib1NMjgogJ1D4fRw8XWT0U=; b=rubt2dPH/++NvCKSIh0ype7Cd6/IN5OrozbK+zb6Y8oXQETgoTTrHCEc0cy3c+bNAZ 1nZeHO+Fo6jGx/OI0B8w2+buKrVpzTl49mSa7g07/PM6x9py3OL99srdgW6I8sQLPI64 l7ZYjNeUfQSr2p6L0ir9eTV46SEj1aZcmo274= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=B5sG/rsuidPMbavFqqak+Ib1NMjgogJ1D4fRw8XWT0U=; b=jArQVVHai45PUfmahtuODOOE8rg9P4E44pPLi4uNJhwIAY5rdErTATsUbVhPmvLzKt sWLwo/iKymXHJlQLehb1EcuXDmcVhj5r7VfxxA3VdfW/Hkv0qgtCNVQA66ll24lbSV7x NeRWdwC4OmYR5b/FzVqxzAD8D1Q/FOBisfcNgKkMhur4wEmEOfX0D3r4jlhdFXD5xo8h Vqiqb8tYfzR7iF5zvp2eM7FEeKvCc4ZghFV3c2yFcfJTly3uIkz7uKn5LwdFMYHVwPH6 nuqPLTrl8tg1+9FpFY2B4jqpuiD9B3S/Cg9YzFx/ybELgfiXIOJxRNXO2i2hwOGFldTp 1EfQ== X-Gm-Message-State: ALoCoQkA8PnWVZyizgQ/1/7d9xu/DPQPzUje+qQuBZ3/hlIoY2GTdyb7/E+NYjjAKIwwzYd9CCxE MIME-Version: 1.0 X-Received: by 10.170.78.85 with SMTP id u82mr4188634yku.72.1414139709777; Fri, 24 Oct 2014 01:35:09 -0700 (PDT) Received: by 10.202.75.71 with HTTP; Fri, 24 Oct 2014 01:35:09 -0700 (PDT) In-Reply-To: <6E04B9BE-854E-4112-8C74-7D90BD8BFE95@ajf.me> References: <6E04B9BE-854E-4112-8C74-7D90BD8BFE95@ajf.me> Date: Fri, 24 Oct 2014 11:35:09 +0300 Message-ID: To: Andrea Faulds Cc: PHP Internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Readonly Properties From: narf@devilix.net (Andrey Andreev) Hi, On Fri, Oct 24, 2014 at 2:36 AM, Andrea Faulds wrote: > Good evening once again, > > Here=E2=80=99s another RFC: https://wiki.php.net/rfc/readonly_properties > > It proposes, with a working implementation, a modifier for properties tha= t 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 fai= rly comprehensive set of twelve tests included in the main patch to php-src= . +1 I've always wanted this, it has never made sense to me to write numerous lines of code just to make an already declared property *readable* from outside a class. __get() has helped to some extent, but it has its disadvantages. Cheers, Andrey.