I've got a PHP script with the following line:
$class = Connection::class;
This runs as expected on PHP 5.5 as explained here: http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.class.class. However, it causes a syntax error in PHP 5.4.
Is there a simple way that I can rewrite this line to run in PHP 5.4?
See if this does it for you:
$class = __NAMESPACE__ ."\\".get_class($connection_object);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With