Re: private, protected, readonly, public
| From: | Hartmut Holzgraefe | Date: | Fri, 12 May 2006 17:32:57 +0000 |
| Subject: | Re: private, protected, readonly, public | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-23313@lists.php.net to get a copy of this message | ||
Bastian Grupe wrote:
Uhh... how about using private and only using a "regular" getter (the Java-style) and no setter? class xx {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 ;) -- Hartmut Holzgraefe, Senior Support Engineer . MySQL AB, www.mysql.com Are you certified? http://www.mysql.com/training/certificationprivate $bar;public getBar() { return $bar; }}