> $objName = "Widgit";
> $objName::getWidgitStatic();
>
> Why does the bottom one not work?

Because $objName is a string variable.  You can't apply a method to a 
string.

You *may* be able to do this (I haven't tested it):

$$objName::getWidgetStatic();

The double-dollar means "interpret the string", which might evaluate 
to "Widgit" and work.

This will definitely work:

eval($objName . "::getWidgetStatic();");

Here you're sticking the string into the eval() expression, so it gets 
intepreted like you want.

HTH,
Jeff

Attachment: pgpaHYMN2s1oq.pgp
Description: PGP signature

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to