Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61289 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74793 invoked from network); 16 Jul 2012 12:25:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jul 2012 12:25:30 -0000 Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.170 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.161.170 mail-gg0-f170.google.com Received: from [209.85.161.170] ([209.85.161.170:48504] helo=mail-gg0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E0/02-63072-73804005 for ; Mon, 16 Jul 2012 08:25:28 -0400 Received: by ggnf2 with SMTP id f2so5772167ggn.29 for ; Mon, 16 Jul 2012 05:25:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=WV4qS1MrlLJS9dyxYcK3wAN1Py6v77KW5bM5/IFMf4M=; b=QxzTPqckqd3tkZ55ar+iomNISDGB4JMbjPgRn+CkWGYPZYMK14RsO/0zNckCkZ8LU9 Zzh0QbYTnYXEkdiMj5Ks5ywofp7bko/Q2QfO1kAoRrvNoeRMznkv6rkQHWRNm89OtKUy yAIKOMpFAtLfOOnbou3Tg7jkkmULt3wigUH/aqot3136uT+8mijIh3bLy/R6RyBZ0PF1 9RWTgkeAdF1QLQsSwdBOXwbEF6SZc9ll787b7S9x679xYTLaJt8oGeYw04CNM7G3MZeo BNJs/z7ZiJYxW06ViVb9nYPfnAHxxMHhy7fbFfrhWt0gMHfqM3gdAt8G4tUjaqcDkCeA GPRw== MIME-Version: 1.0 Received: by 10.66.78.42 with SMTP id y10mr22398907paw.31.1342441524880; Mon, 16 Jul 2012 05:25:24 -0700 (PDT) Received: by 10.68.54.169 with HTTP; Mon, 16 Jul 2012 05:25:24 -0700 (PDT) Date: Mon, 16 Jul 2012 14:25:24 +0200 Message-ID: To: PHP Internals Content-Type: multipart/alternative; boundary=f46d042e00f738e36d04c4f18698 Subject: supporting the final keyword for properties From: tyra3l@gmail.com (Ferenc Kovacs) --f46d042e00f738e36d04c4f18698 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, The recent http://www.mail-archive.com/internals@lists.php.net/msg59301.htm= l discussion made me wonder why did we decide not supporting the final keywords for properties as it would provide an easy way for read-only attributes (const would be a better choice in performance wise, but then you can only set it in your declaration where no dynamic expression is allowed.) 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). What do you think? Would this be viable? Is there any still-present reason why we shouldn't support that? --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --f46d042e00f738e36d04c4f18698--