Created
August 1, 2011 19:43
-
-
Save gr4y/1118836 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| /** | |
| * That's why i hate PHP... | |
| */ | |
| private static function method_exists($array){ | |
| if(count($array) == 2) return method_exists($array[0], $array[1]); | |
| else throw new Exception("method_exists needs an array with exactly 2 arguments"); | |
| } | |
| /* | |
| * Turns out, PHP has this method already. It is called 'is_callable' | |
| * Thanks to @gigalinux | |
| */ | |
| is_callable($array); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment