Re: public readonly variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 23 April 2010 18:10, Ashley Sheridan <ash@xxxxxxxxxxxxxxxxxxxx> wrote:
> I think for now I'll just resort to leaving it as a public variable.
> I'll leave the specific set function for it in and just hope that is
> used instead! As it's only me who'll be using it for the time being, I
> can always yell at myself later if I forget!

You're using a setter but a public variable? That's about the worst
compromise, isn't it? Either go down the road of the public variable
or the setter/getter (and in your case I would definitely recommend
the latter). Also, __get/__set are fine, as long as you don't use them
for everything (i.e. 5 magic calls per request will do very, very
little to your app, whereas 1000 per request will have some
significance on a site with lots of users).

Regards
Peter

-- 
<hype>
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
Flickr: http://www.flickr.com/photos/fake51
BeWelcome: Fake51
Couchsurfing: Fake51
</hype>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux