I have a bunch of subclasses that define a static varible that I need
to access in the parent class. So I'm trying something like:

$_staticvarname = get_class($this) . '::$_staticvar';
print_r($$_staticvarname);

But this doesn't work. I just get:

  Undefined variable: Sublcass::$_staticvar

If I do:

  print_r(Subclass::$_staticvar)

it works so I know it's just an evaluation issue.

I can't use const because the variable is an array. I don't want to
hardcode the subclass name in the parent class and I want to use a
static variable reasoning that it uses less memory.

Is there any way to do this?

Mike

-- 
Michael B Allen
PHP Active Directory SPNEGO SSO
http://www.ioplex.com/
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to