[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pear-dev
Subject:    [PEAR-DEV] New signature for Net_Socket::write()
From:       Christian Schmidt <lists () chsc ! dk>
Date:       2008-02-19 21:40:12
Message-ID: 47BB4CBC.80807 () chsc ! dk
[Download RAW message or body]

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

-- 
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic