Why does the page callback have two arguments? function menufun_menu() {
  $items['menufun/%/bar/baz'] = array(
    'title' =&gt; 'Hi',
    'page callback' =&gt; 'menufun_hello',
    'page arguments' =&gt; array(1), // The matched wildcard.
    'access callback' =&gt; TRUE,
  );

  return $items;
}

/**
* Page callback.
*/
function menufun_hello($a = NULL, $b = NULL) {
  return t('Hello. $a is @a and $b is @b', array('@a' =&gt; $a, '@b' =&gt; $b));
}


In the menufun_menu() function, the page argument for the menufun_hello callback is only one. Why does menufun_hello() have two parameters?
Menu callbacks are passed first the arguments defined in page arguments then excess arguments from the url.

So in the above example:

menufun/1/bar/baz


Will provide these vars:

$a = 1;
$b = NULL;


If you however provide an extra argument in the url:

menufun/1/bar/baz/2


You will transfer it to the menu callback:

$a = 1;
$b = 2;


The other advantedge is like tim writes, that it allows reuse of the same code for various cases, making the module more maintainable.