NYCPHP Meetup

NYPHP.org

[nycphp-talk] static variable variable?

Michael B Allen ioplex at gmail.com
Thu Dec 20 11:00:32 EST 2007


On 12/20/07, John Campbell <jcampbell1 at gmail.com> wrote:
> Humm...
>
> The only thing I can think of is to do something like:
> $v = get_class_vars(get_class($this));
> print_r($v['_staticvar']);

This does work in my case.

But, I the code could get invoked quite a bit which makes me wonder if
the overhead of calling those functions and building the vars array
would offset the benefit of storage savings from using a static array.

I have opted for the KISS approach and just used a non-static array instead.

That is a neat trick though. I'll have to remember this one.

Thanks,
Mike

-- 
Michael B Allen
PHP Active Directory SPNEGO SSO
http://www.ioplex.com/



More information about the talk mailing list