Req #30699 [Opn->Fbk]: Have gethostbyname return error information in additional variables

From: Date: Mon, 21 Apr 2014 20:25:08 +0000
Subject: Req #30699 [Opn->Fbk]: Have gethostbyname return error information in additional variables
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-185354@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=30699&edit=1 ID: 30699 Updated by: levim@php.net Reported by: techtonik@php.net -Summary: make gethostbyname return error status in additional variables +Summary: Have gethostbyname return error information in additional variables -Status: Open +Status: Feedback Type: Feature/Change Request -Package: Feature/Change Request +Package: Network related Operating System: Irrelevant -PHP Version: 4.3.9 +PHP Version: * Block user comment: N Private report: N New Comment: At a glance I was unable to find any update to this; is this something you are still interested in? Previous Comments: ------------------------------------------------------------------------ [2004-11-06 11:21:20] techtonik@php.net 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 this bug report at https://bugs.php.net/bug.php?id=30699&edit=1

« previous php.bugs (#185354) next »