Created
June 10, 2015 20:56
-
-
Save lsloan/3a331dc14ad8f2c3c328 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Class ClassUtil | |
* | |
* Provide useful methods to overcome OOP shortcomings in some versions of PHP. | |
*/ | |
class ClassUtil { | |
/** | |
* The "::class" notation isn't available until PHP 5.5. This method is a workaround for | |
* older versions of PHP. | |
* | |
* @return string Name of this class | |
*/ | |
static public function className() { | |
return get_called_class(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment