Doc #60824 [NEW]: gethostbyaddr() returns FALSE on failure
| From: | alvaro at demogracia dot com | Date: | Fri, 20 Jan 2012 20:07:52 +0000 |
| Subject: | Doc #60824 [NEW]: gethostbyaddr() returns FALSE on failure | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-7798@lists.php.net to get a copy of this message | ||
From:
Operating system:
PHP version: 5.3.9
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:gethostbyaddr() returns FALSE on failure
Description:
------------
---
From manual page: http://www.php.net/function.gethostbyaddr
---
In "Return Values" we read:
«Returns the host name or the unmodified ip_address on failure.»
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
However, there are situations where the function appears to return FALSE on
failure.
Test script:
---------------
<?php
// Return unmodified argument
var_dump( gethostbyaddr(33) );
var_dump( gethostbyaddr('192.168.0.100') ); // Non-existing LAN address
// Return FALSE and trigger a warning
var_dump( gethostbyaddr(NULL) );
var_dump( gethostbyaddr('php.net') );
Expected result:
----------------
string(2) "33"
string(13) "192.168.0.100"
string(0): ""
string(7): "php.net"
Actual result:
--------------
string(2) "33"
string(13) "192.168.0.100"
Warning: gethostbyaddr(): Address is not a valid IPv4 or IPv6 address in
C:\tmp\test.php on line 8
bool(false)
Warning: gethostbyaddr(): Address is not a valid IPv4 or IPv6 address in
C:\tmp\test.php on line 9
bool(false)
--
Edit bug report at https://bugs.php.net/bug.php?id=60824&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60824&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60824&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60824&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=60824&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60824&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=60824&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=60824&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=60824&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=60824&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=60824&r=support
Expected behavior: https://bugs.php.net/fix.php?id=60824&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=60824&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=60824&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=60824&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60824&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=60824&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=60824&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=60824&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=60824&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=60824&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=60824&r=mysqlcfg