tags:

views:

30

answers:

2

Hello,

I need to use: $site->self::filter_name

Obviously that returns a Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in error

Thanks

Edit: Answer is: $site->{self::filter_name}

A: 

Simply use Classname::$filter_name. Classname is the class which $site is an instance of.

If you don't know the class of the instance, you may use this (as of PHP 5.3!):

$className = get_class($instance);
$className::$staticProperty;
nikic
Its a seperate object.Ive managed to fix it via: $site->{self::filter_name}
azz0r
Oh sorry, I misunderstood you.
nikic
A: 

Answer is: $site->{self::filter_name}

azz0r