From: [EMAIL PROTECTED] Operating system: Irrelevant PHP version: 4.3.9 PHP Bug Type: Feature/Change Request Bug description: make gethostbyname return error status in additional variables
Description: ------------ It will be helpful to make gethostbyname return error status in additional variables like fsockopen does for example in int &errno, string &errstr. Now gethostbyname returns a string containing the unmodified hostname on failure, but rather often it is desirable to know why the operation failed and output standart system text error message without inventing own ones. That way you can search information on internet with a higher probability to find an answer in case of errors. It should not be too difficult to implement since WSAGetLastError() from WinSock2 returns generic error code and here you can find error code descriptions. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/windows_sockets_error_codes_2.asp Expected result: ---------------- string gethostbyname ( string hostname[, int &errno [, string &errstr]] ) Actual result: -------------- string gethostbyname ( string hostname ) -- Edit bug report at http://bugs.php.net/?id=30699&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30699&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30699&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30699&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=30699&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=30699&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30699&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30699&r=needscript Try newer version: http://bugs.php.net/fix.php?id=30699&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30699&r=support Expected behavior: http://bugs.php.net/fix.php?id=30699&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30699&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30699&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=30699&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30699&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=30699&r=dst IIS Stability: http://bugs.php.net/fix.php?id=30699&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30699&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30699&r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30699&r=mysqlcfg