I am currently facing an inconvenience concerning accessing static members of a class served by a Registry Pattern function.
The ideal code I would like to use is below. It accesses a constant in the base class, that is served via the static method get()
of the registry class.
echo "<link rel='shortcut icon' href='" . Registry::get('base')::SHORTCUT_ICON . "'>";
At the moment I can only work the code like this:
$base = Registry::get('base');
echo "<link rel='shortcut icon' href='" . $base::SHORTCUT_ICON . "'>";
I don't know exactly what this feature would be called, however I thought something similar was being introduced in PHP 5.4 - Access array returned by a function in php. And here https://wiki.php.net/rfc/functionarraydereferencing
Question
Is there a neat one-line solution around this problem, or will it have to remain a messy two-liner?