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

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -