public readonly variables

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

 



I know the subject line might sound a bit like an oxymoron, but bear
with me!

What I'd like to have is a property of an object that behaves like a
public variable when it comes to reading, but like a protected one when
it comes to writing, as it would make my code a lot easier to read.

I know about the __get($var) method to magically provide this behaviour,
but from all I've read it can be pretty slow compared to a regular
public variable. I've seen a thread on the dev lists where someone
requested it, but can't find anything in the manual.

Does anyone know if this is available in a later version of PHP, or if
it's implementation is penned for some time in the future?

Thanks,
Ash
http://www.ashleysheridan.co.uk



[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