Re: Attributes vs. Accessors

From: Date: Mon, 25 Aug 2008 15:01:58 +0000
Subject: Re: Attributes vs. Accessors
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-278675@lists.php.net to get a copy of this message
>> Curious. Which do you prefer and why? Accessor methods. They allow for changes in the future that may well be unforeseen at the moment. Or at least that would be my response with PHP4. Now with the __get and __set built-in accessors, that's pretty much taken care of. > I access directly to avoid pointless method calls for reads. It'd be > nice if there were a way to define a public read-only mode, Not tried this, but you may be able to do it with a __get method that doesn't return anything. -- Richard Heyes http://www.phpguru.org

« previous php.general (#278675) next »