menu_execute_active_handler(), which is the Drupal function that calls the menu callback, contains the following code:
if ($router_item = menu_get_item($path)) {
if ($router_item['access']) {
if ($router_item['file']) {
require_once($router_item['file']);
}
return call_user_func_array($router_item['page_callback'], $router_item['page_arguments']);
}
else {
return MENU_ACCESS_DENIED;
}
}
In PHP 5.2.3, or higher, is possible to call call_user_func()
as call_user_func('MyClass::myCallbackMethod')
.
The only problem I can see is with third-party modules that don't expect a menu callback is a class static method, and use function_exists($menu_callback)
.
Then, as Coder1 reported, if Drupal core modules, or other modules, try to call the menu_callback using code similar to the following, then they could cause a PHP error.
$menu_callback = $router_item['page_callback'];
$menu_callback($router_item['page_arguments']);