title: PHP fsockopen doesnt return anything
body: <p>I am modifying a PHP db wrapper for the redis database.</p>
  
  <p>Here's how my function looks:</p>
  
  <pre><code>public function connect() {
  
      $sock = @fsockopen('localhost', '6379',  $errno, $errstr, 2);
  
      if ($sock === FALSE) {
          return FALSE;
      }
      else {
          stream_set_timeout($sock, 2); 
          return $sock;
      }
  }
  </code></pre>
  
  <p>What I want to do is to call this function from another part in my wrapper:</p>
  
  <pre><code> if ($this-&gt;connect() !== FALSE) {
        // Do stuff
   }
  </code></pre>
  
  <p>How can I get my connect function to send a FALSE when the fsockopen isn't working?</p>
  
  <p>Thanks!</p>