Doc #60781 [Com]: getprotobyname: returns FALSE, not -1

From: Date: Wed, 18 Jan 2012 02:39:46 +0000
Subject: Doc #60781 [Com]: getprotobyname: returns FALSE, not -1
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-7787@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=60781&edit=1 ID: 60781 Comment by: laruence at gmail dot com Reported by: phpmpan at mpan dot pl Summary: getprotobyname: returns FALSE, not -1 Status: Open Type: Documentation Problem Package: Documentation problem Operating System: * PHP Version: Irrelevant Block user comment: N Private report: N New Comment: this was introduced since 2002.. http://svn.php.net/viewvc/php/php-src/trunk/ext/standard/basic_functions.c? view=log&pathrev=98153 Previous Comments: ------------------------------------------------------------------------ [2012-01-17 15:54:07] phpmpan at mpan dot pl Description: ------------ --- From manual page: http://www.php.net/function.getprotobyname#refsect1-function.getprotobyname-returnvalues --- Documentation says "-1 if the protocol is not found", but function returns FALSE if the protocol is not found. Related to bug#60779 and similar bug#52662 for getprotobynumber. Test script: --------------- <?php // Based on code from #60779 $protocol = 'BLA'; $get_prot = getprotobyname($protocol); var_dump($get_prot); ?> Expected result: ---------------- Return Values Returns the protocol number or FALSE if the protocol is not found. Actual result: -------------- Return Values Returns the protocol number or -1 if the protocol is not found. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=60781&edit=1

« previous php.doc.bugs (#7787) next »