Re: private, protected, readonly, public
| From: | Ron Korving | Date: | Tue, 16 May 2006 13:31:15 +0000 |
| Subject: | Re: private, protected, readonly, public | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-23456@lists.php.net to get a copy of this message | ||
That's a good point. It was just an idea really, hoping to provide an easy
way out for the whole discussion ;)
Ron
""Stefan Walk"" <stefan.walk@gmail.com> schreef in bericht
news:4858f9d90605160625u11fcaef8ta07fc199558eca9f@mail.gmail.com...
On 5/16/06, Ron Korving <r.korving@xit.nl> wrote:
> <?php
>
> class Foo
> {
> private $bar = 5;
> }
>
> $foo = new Foo();
> echo $foo->bar; // prints 5
> $foo->bar = 4; // error
>
> ?>
I'm against visible private variables. If they are visible, they are
part of the interface of the class, which means changing the
implementation means a BC break. If this functionality is going in,
please do it only for protected...
Regards,
Stefan