title: PHP imap: if can't connect, just return, but warning message still displaying
body: <p>I have a function that tries to grab some emails using the imap library. If it can't connect I would like the function to just return without doing anything else.</p>
  
  <pre><code>$imap = imap_open($mailboxPath, $username, $password);
  if (!$imap)
    return 0;
  </code></pre>
  
  <p>This works but I still get a PHP warning message that the connection attempt has failed from a timeout. Can I prevent this warning from being displayed?</p>