Re: how to mark protected properties?

From: Date: Mon, 07 Jun 2004 23:15:53 +0000
Subject: Re: how to mark protected properties?
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-30110@lists.php.net to get a copy of this message
Bertrand Mansion wrote:
Everything should be protected by default in OO code. PHP makes everything public by default, that's just a design error and defeats the whole point of data encapsulation, probably due to BC. I won't prefix all my instance vars with _. Users are free to refer to the API documentation.
IMHO, as silly as sounds to prefix all vars with '_', sounds to create dozen methods/calls for getting access to those protected vars. Tomas V.V.Cox

« previous php.pear.dev (#30110) next »