menu_execute_active_handler () , which is a 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 later, you can call call_user_func() as call_user_func('MyClass::myCallbackMethod') .
The only problem I see is third-party modules that do not expect the menu callback to be a static class method, and use function_exists($menu_callback) .
Then, as Coder1 reported, if the main Drupal modules or other modules try to call menu_callback using code similar to the following, then they can cause a PHP error.
$menu_callback = $router_item['page_callback']; $menu_callback($router_item['page_arguments']);
source share