#29737 [Csd->Opn]: ip2long() works not as documented
| From: | belikoviv at is dot lg dot ua | Date: | Wed, 06 Apr 2005 10:16:47 +0000 |
| Subject: | #29737 [Csd->Opn]: ip2long() works not as documented | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969367569@lists.php.net to get a copy of this message | ||
ID: 29737
User updated by: belikoviv at is dot lg dot ua
Reported By: belikoviv at is dot lg dot ua
-Status: Closed
+Status: Open
-Bug Type: Network related
+Bug Type: Documentation problem
Operating System: Windows 2000 SP4; Fedora Core 2
PHP Version: 5.0.0
New Comment:
Function ip2long() fixed long time ago, but now I see incorrect note in
documentation (at bottom of the chapter):
"Note: ip2long() will return -1 (PHP 4) or FALSE (PHP 5) for the IP
255.255.255.255"
This is incorrect. ip2long returns -1 in both PHP4 and PHP5 for IP
255.255.255.255. Value "-1" is _correct_ value for 255.255.255.255, so
that note must be deleted from documentation. Note about PHP4 is exist
near the top of chapter.
Previous Comments:
------------------------------------------------------------------------
[2004-08-19 18:44:43] tony2001@php.net
Be patient, Win32 snaps are not ready yet.
Latest PHP5 win32 snapshot was built on: Aug 19, 2004 08:30 GMT.
------------------------------------------------------------------------
[2004-08-19 18:18:25] belikoviv at is dot lg dot ua
Sorry, but problem not fixed - I try php5-win32-latest.zip and
php5.0-win32-200408190830.zip. Both snapshots return FALSE on address
255.255.255.255.
------------------------------------------------------------------------
[2004-08-19 16:04:35] tony2001@php.net
Fixed in CVS, thanks.
------------------------------------------------------------------------
[2004-08-19 16:04:11] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
------------------------------------------------------------------------
[2004-08-19 15:57:42] belikoviv at is dot lg dot ua
Since version 5.0 ip2long returns FALSE on invalid address. It is
documented, and it is correct.
But ip2long returns FALSE on 255.255.255.255 - it is _not_ correct,
because 255.255.255.255 is _valid_ address.
Documentation says that ip2long returns -1 on 255.255.255.255 - it is
_correct_, because unsigned 0xffffffff is signed -1.
Unfortunatelly, I cannot fix this error by myself...
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/29737
--
Edit this bug report at http://bugs.php.net/?id=29737&edit=1