Why does user_load($id) NOT return FALSE when an invalid id is passed in? I'm making a module that lets users manage database records for various organizations.  I'm using Drupal 7 and an very new at it.  I'm logged in as the admin user. I have a menu item 'cb' that checks args and returns content generated by various functions, here it is in the menu:

function org_menu() {
  $items['org'] = array(
    'title' =&gt; 'My Orgs',
    'page callback' =&gt; 'org_show_orgs',
    'access callback' =&gt; TRUE,
  );
  $items['org/create_org'] = array(
    'title' =&gt; 'Create New Org',
    'page callback' =&gt; 'drupal_get_form',
    'page arguments' =&gt; array('org_create_form'),
    'access callback' =&gt; TRUE,
  );
  $items['org/search_orgs'] = array(
    'title' =&gt; 'Find Orgs',
    'page callback' =&gt; 'drupal_get_form',
    'page arguments' =&gt; array('org_search'),
    'access callback' =&gt; TRUE,
  );
  $items['org/cb'] = array(
    'type' =&gt; MENU_CALLBACK,
    'page callback' =&gt; 'custom_callback',
  );
  return $items;
}


And this is the cb function that determines what I am trying to do, and calls the appropriate content function:

function custom_callback () {
  if ( arg(2)=="edit" )
    return org_edit_org();
  if ( arg(2)=="view" ) {
    return org_show_orgs();
  }
  return "&lt;H3&gt;Invalid callback function: '".arg(2)."'";
}


and the actual org_get_orgs function:

function org_show_orgs() {
  global $user;
  $acctid=arg(3);
  if ( !$acctid &amp;&amp; $user-&gt;uid==0 )
    return array('my_content' =&gt; '&lt;H3&gt;My Orgs&lt;/H3&gt;Please log in to view your orgs.'.
                    '&lt;BR&gt;&lt;H3&gt;Find Orgs&lt;/H3&gt;', drupal_get_form('org_search'));

  if ( $acctid ) {
    //return "case1 arg0=".arg(0)."&lt;BR&gt;arg1=".arg(1)."&lt;BR&gt;arg2=".arg(2)."&lt;BR&gt;arg3="
    //              .arg(3)."&lt;BR&gt;arg4=".arg(5)."&lt;BR&gt;acctid=$acctid&lt;BR&gt;&lt;BR&gt;";
    $account=user_load($acctid);
    //return "case2 arg0=".arg(0)."&lt;BR&gt;arg1=".arg(1)."&lt;BR&gt;arg2=".arg(2)."&lt;BR&gt;arg3="
    //              .arg(3)."&lt;BR&gt;arg4=".arg(5)."&lt;BR&gt;acctid=$acctid&lt;BR&gt;&lt;BR&gt;";
    if ( $account===FALSE )
      return "&lt;H3&gt;Invalid acctid "+$acctid+"&lt;/H3&gt;";
    else
      return "&lt;H3&gt;account was not FALSE&lt;/H3&gt;";
  }
}


cb() gets called correctly and the org_show_orgs() function gets called as expected.  arg(3) is the user id, so I can allow a user to view another user's orgs.

I hit the url 
http://example.com/?q=org/cb/view/1 
and it works - I see admin's orgs.  If I pick a userid for another user, it works - I see their orgs as well.  The problem is when I tinker with the url and pass in an id of a user that doesnt exist - then I get all kinds of weirdness.  For example, if I hit

http://example.com/?q=org/cb/view/4

If I uncomment that case2 line, I clearly see all my variables are correct:

case2 arg0=org
arg1=cb
arg2=view
arg3=4
arg4=
acctid=4


but if I try to test if $account===FALSE, I get the maintenance page.  If I change the id to 3, I get an 'access denied' page.  If I change the id to 2, I see a 'page not found' page.  If I try return print_r($account,TRUE); I get the menus and a completely blank content cell.  No error, which I'd get it it was a non-array object.  If I try get_class($account) after I retrieve it, I get the menus but no css, and everything is just listed down the left side, no regions, themes, nothing.  

Besides the $account issue, is there a better way to be doing this than that callback menu, or is that the drupal way?
The account test probably is working, but this is wrong:

return "&lt;H3&gt;Invalid acctid "+$acctid+"&lt;/H3&gt;";


If the $acctid is an integer, it's evaluating that and returning an integer.  The proper php concatenation operator is '.' (without the quotes), change your return statement to

return "&lt;H3&gt;Invalid acctid ".$acctid."&lt;/H3&gt;";


It'll evaluate to the string you're presumably expecting.