Получить статическое свойство экземпляра

If I have an instance in PHP, what's the easiest way to get to a static property ('class variable') of that instance ?

This

$classvars=get_class_vars(get_class($thing));
$property=$classvars['property'];

Sound really overdone. I would expect

$thing::property

or

$thing->property

EDIT: this is an old question. There are more obvious ways to do this in newer PHP, search below.

17
задан commonpike 17 June 2019 в 08:57
поделиться