class A {
public static $foo = 42;
}
$class = 'A';
$attribute = 'foo';
var_dump(isset($class::$attribute)); //gives bool(false)
How can i checkt, of this static attribute exists in this class?
class A {
public static $foo = 42;
}
$class = 'A';
$attribute = 'foo';
var_dump(isset($class::$attribute)); //gives bool(false)
How can i checkt, of this static attribute exists in this class?
Use variable variables:
If you don't have PHP 5.3 yet the only accurate way is probably using the Reflection API:
In 5.3, you can simply do