Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63587 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67506 invoked from network); 21 Oct 2012 15:23:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Oct 2012 15:23:57 -0000 Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.170 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.217.170 mail-lb0-f170.google.com Received: from [209.85.217.170] ([209.85.217.170:45751] helo=mail-lb0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 64/13-22055-C8314805 for ; Sun, 21 Oct 2012 11:23:57 -0400 Received: by mail-lb0-f170.google.com with SMTP id gm13so1267035lbb.29 for ; Sun, 21 Oct 2012 08:23:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=7ZuZ7fzhqFYIaiD3N1uEJzA2bhRFQcBXooXHfwKv34U=; b=XrpqCsrozcovkYH1emdEw59qzqTyhJWgdBIl1aAXnqmMP25nkOag3NT/pSEG8+yCY3 ikyc0dO1+5A8eV1umZ+S6Y1yJopT1aBWeLOGWgGK/lpNnxGGCVtIWgVZU1q1n2BGI70g nqB+LZPdlqnEmnSiyX9t8TqwV/fX2RaXfHABC6SIR1Xfpvzy+FfyZ3rwocIa916qP2ac TGYAZgKOjxcPYtQa+j16ULZbQ3/0SWC4woueQpSEVJRK0MOMX5BUCVWDcN6JgWJ7rVFK djQr+HrFyI1CJeWnJ06YLuS/iFRca4tdvI5845QTvd2MgXmF+XcErYiKX6txvcH9wPG7 ymmw== MIME-Version: 1.0 Received: by 10.152.108.37 with SMTP id hh5mr5939296lab.52.1350833033965; Sun, 21 Oct 2012 08:23:53 -0700 (PDT) Received: by 10.112.36.39 with HTTP; Sun, 21 Oct 2012 08:23:53 -0700 (PDT) In-Reply-To: References: <9570D903A3BECE4092E924C2985CE485612C2595@MBX214.domain.local> Date: Sun, 21 Oct 2012 09:23:53 -0600 Message-ID: To: Amaury Bouchard Cc: Nikita Popov , Clint Priest , "internals@lists.php.net" Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] [RFC] Accessors : read-only / write-only keywords From: morrison.levi@gmail.com (Levi Morrison) I would like to point out that in my mind `const` and `read-only` are not necessarily the same thing. Read-only means that from outside the class it cannot be modified; the internal class can change it whenever it wants. Const means that once the value is set it will NEVER change. Big difference. Also, I feel like there is no need for the read-only keyword. Defining a getter and not a setter should suffice in my opinion. The absence of the setter declares intent well, in my opinion. If for some reason you need to enforce that nobody inherits it and sets the property, then declaring a setter and issuing an error or exception would suffice. Let's not clutter up the language for such a simple idea.