New signature for Net_Socket::write()

From: Date: Tue, 19 Feb 2008 21:40:12 +0000
Subject: New signature for Net_Socket::write()
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-49174@lists.php.net to get a copy of this message
Packages using Net_Socket should probably be aware of this: http://pear.php.net/bugs/bug.php?id=13107 Until recently, the documentation for Net_Socket::write() has stated that the return value was either true on success, or a PEAR_Error instance on failure. However, the function sometimes returns false in case of an error. The phpdoc has now been updated to reflect this: http://cvs.php.net/viewvc.cgi/pear/Net_Socket/Socket.php?r1=1.37&r2=1.38 Packages using this method should check the return value like this:
    $ok = $socket->write($data);
    if ($ok === false || PEAR::isError($ok)) {
        //  something went wrong
    }
Christian

« previous php.pear.dev (#49174) next »