[PHP-DEV] Bug #419 Updated: fsockopen() doesn't return meaningful error codes From: Bug Database (php-dev <email protected>)
Date: 05/30/98

ID: 419
Updated by: rasmus
Reported By: explorer-php3 <email protected>
Status: Closed
Bug Type: Misbehaving function
Assigned To: rasmus
Comments:

Ok, this has been cleaned up. fsockopen() now returns FALSE like all the other PHP functions on a failure, but in order to get useful information from a failure you can now pass in two optional arguments (by reference).

ie.

  fsockopen($ip,$port,&$errno,&$errstr)

These will be set to the errno and error string that come back from the system-level connect() call.

Full Bug description available at: http://ca.php.net/bugs.php3?id=419