Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78427 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59394 invoked from network); 28 Oct 2014 14:08:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Oct 2014 14:08:17 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.216 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.216 imap10-3.ox.privateemail.com Received: from [192.64.116.216] ([192.64.116.216:55188] helo=imap10-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2A/D5-21571-053AF445 for ; Tue, 28 Oct 2014 09:08:17 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 514552400C3; Tue, 28 Oct 2014 10:08:14 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap10.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap10.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 3Dw1oLYtj4_t; Tue, 28 Oct 2014 10:08:14 -0400 (EDT) Received: from oa-res-26-28.wireless.abdn.ac.uk (oa-res-26-28.wireless.abdn.ac.uk [137.50.26.28]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 9CA972400DD; Tue, 28 Oct 2014 10:08:13 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) In-Reply-To: <544F4321.8040302@seld.be> Date: Tue, 28 Oct 2014 14:08:10 +0000 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: References: <6E04B9BE-854E-4112-8C74-7D90BD8BFE95@ajf.me> <544D48A3.6070905@gmail.com> <572FEBD1-99A8-4788-83F9-D99E470FB16D@ajf.me> <544F4321.8040302@seld.be> To: Jordi Boggiano X-Mailer: Apple Mail (2.1990.1) Subject: Re: [PHP-DEV] [RFC] Readonly Properties From: ajf@ajf.me (Andrea Faulds) > On 28 Oct 2014, at 07:17, Jordi Boggiano wrote: >=20 > I like it, except for the fact that if you add a custom getter to a = property suddenly it becomes readonly unless you remember to add "; set" = to the end of the block, right? Well, no. If you choose to specify getters and setters, and only specify = a setter, of course it is read-only. It doesn=E2=80=99t make sense to = have a getter and no setter and yet expect a property to be writeable. > How about this instead for readonly: >=20 > public $foobar { > get { return $this->bar * $this->foo; }; readonly > } >=20 > And if the flag isn't there, set is implicitly present. This is really confusing and I don=E2=80=99t think it=E2=80=99s a good = idea.=20 -- Andrea Faulds http://ajf.me/