// minor thing .. the reason I mentioned PEAR coding standards is that this function ping() { if($this->lastping < time() - 300) $this->socket->send('PING bambotoo' . "\n\r"); if($this->lastping < time() - 500) $this->connected = false; } //should be like this - to make it more readable function ping() { if($this->lastping < time() - 300){ $this->socket->send('PING bambotoo' . "\n\r"); } if($this->lastping < time() - 500){ $this->connected = false; } }