Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:23337 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41248 invoked by uid 1010); 14 May 2006 01:56:40 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 41233 invoked from network); 14 May 2006 01:56:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 May 2006 01:56:40 -0000 X-PHP-List-Original-Sender: alan@akbkhome.com X-Host-Fingerprint: 202.81.246.113 246-113.netfront.net Received: from ([202.81.246.113:37373] helo=akbkhome.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id BB/DC-19568-65E86644 for ; Sat, 13 May 2006 21:56:39 -0400 Received: from [192.168.0.184] by akbkhome.com with esmtp (Exim 4.61) (envelope-from ) id 1Ff5vx-0008Ot-76; Sun, 14 May 2006 10:02:14 +0800 Message-ID: <44668EF8.1080906@akbkhome.com> Date: Sun, 14 May 2006 09:59:20 +0800 User-Agent: Mozilla Thunderbird 0.8 (X11/20040926) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Hartmut Holzgraefe CC: Bastian Grupe , Jason Garber , internals@lists.php.net References: <785810036.20060511193536@ionzoft.com> <4464AC64.5050706@gmail.com> <4464C6C9.40307@php.net> In-Reply-To: <4464C6C9.40307@php.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ACL-Warn: "cleared badlog" Subject: Re: [PHP-DEV] private, protected, readonly, public From: alan@akbkhome.com (Alan Knowles) Definatly would love to see readonly, It would remove 1000's of lines of useless code from 100's of projects - which might make a few more public PHP projects readable ;) It replaces pointless giberish with something explicit clean and elegant.. Looks alot tidier than getters, or __get kludges. Regards Alan Hartmut Holzgraefe wrote: > Bastian Grupe wrote: > >> Uhh... how about using private and only using a "regular" >> getter (the Java-style) and no setter? >> >> class xx >> { >> private $bar; >> >> public getBar() { return $bar; } >> } > > > i think you're missing the point, the idea is to *not* > have to write that extra getter line ... less typing > *and* less error prone ... and easier to read, too IMHO > > You didn't want to return $bar in your example, you wanted > to return $this->bar so you already ran into one of the > issues here ;) >