php - Get a static property of an instance -
if have instance in php, what's easiest way static property ('class variable') of instance ?
this
$classvars=get_class_vars(get_class($thing)); $property=$classvars['property']; sound overdone. expect
$thing::property or
$thing->property
you need lookup class name first:
$class = get_class($thing); $class::$property $property must defined static , public of course.
Comments
Post a Comment