Think I need to use reflection to make this 5.3 code work on 5.2 but having issues.
We are on a server that only has PHP 5.2, upgrade is not possible at this time per hosting company but a class we need has issues on 5.2 since the class uses 5.3 syntax.
Here is the code I need help with:
static public function instance($class) {
if (!isset($class::$instance)) {
$class::$instance = new $class();
$class::$instance->initialize();
MobileHelper::registerDevice($class::$instance);
}
return $class::$instance;
}
I have seen a number of answers on questions that note to use reflection, but they are all basic examples, I don't know enough to convert them into the solution here, but I have tried. Any expert here able to help on this?
Here, same using Reflection.