function get_reflection($callback)
{
if (is_array($callback)) {
list($class, $method) = $callback;
return new ReflectionMethod($class, $method);
}
if (is_string($callback) && strpos($callback, "::") !== false) {
list($class, $method) = explode("::", $callback);
return new ReflectionMethod($class, $method);
}
if (version_compare(PHP_VERSION, "5.3.0", ">=") && method_exists($callback, "__invoke")) {
return new ReflectionMethod($callback, "__invoke");
}
if (is_string($callback) && strpos($callback, "::") == false && function_exists($callback)) {
return new ReflectionFunction($callback);
}
return false;
}