Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67578 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24344 invoked from network); 28 May 2013 08:58:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 May 2013 08:58:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=lars@strojny.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=lars@strojny.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain strojny.net from 46.4.40.248 cause and error) X-PHP-List-Original-Sender: lars@strojny.net X-Host-Fingerprint: 46.4.40.248 milch.schokokeks.org Received: from [46.4.40.248] ([46.4.40.248:51901] helo=milch.schokokeks.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B1/8C-44058-EB174A15 for ; Tue, 28 May 2013 04:58:39 -0400 Received: from [192.168.1.56] (p5099f5c8.dip0.t-ipconnect.de [::ffff:80.153.245.200]) (AUTH: PLAIN lars@schokokeks.org, TLS: TLSv1/SSLv3,128bits,AES128-SHA) by milch.schokokeks.org with ESMTPSA; Tue, 28 May 2013 10:58:34 +0200 id 000000000000002B.0000000051A471BA.000064F5 Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) In-Reply-To: Date: Tue, 28 May 2013 10:58:33 +0200 Cc: PHP Internals Content-Transfer-Encoding: quoted-printable Message-ID: <06F1F2BA-A054-4B62-AD06-90B621995ADD@strojny.net> References: To: Ferenc Kovacs X-Mailer: Apple Mail (2.1503) Subject: Re: [PHP-DEV] supporting the final keyword for properties From: lars@strojny.net (Lars Strojny) Hi Ferenc, Am 28.05.2013 um 08:15 schrieb Ferenc Kovacs : [...] >> I would like it to work the same way as it does in java( >> = http://docs.oracle.com/javase/specs/jls/se7/html/jls-4.html#jls-4.12.4) >> eg. you can set the initial value either in the declaration or later = on, >> but after it is set, you can't change it, trying to do that would = create a >> recoverable fatal error (or throwing an exception which extends >> RuntimeException). >>=20 >> What do you think? Would this be viable? Is there any still-present = reason >> why we shouldn't support that? [...] > the accessors rfc got rejected, so I'm bringing this up again. It=92s a good idea in general but what about having it for variables as = well? Could open interesting possibilities for an optimizer. final $foo =3D "str"; $foo =3D "bar"; // bails out cu, Lars=