class ab{
public static $abc = 34;
public static function asd(){
$a = "abc";
echo self::$a; //output 34;
}
}
ab::asd();
i want to find a way to point to a class static member .like the example above,how can i make this work?
If you access a static variable, the syntax is the following:
So what you’re doing lacks the indirection:
This works with regular variables the same way:
and with indirection:
An advice for your next question: Try to be more precise in your question. Pay attention to the following:
This helps to give relevant answers more quickly instead of engaging in a meta-discussion to clarify your question.