Re: private, protected, readonly, public

From: Date: Tue, 16 May 2006 13:25:22 +0000
Subject: Re: private, protected, readonly, public
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On 5/16/06, Ron Korving <[email protected]> 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

Thread (92 messages)

« previous php.internals (#23455) next »