#29737 [Opn]: ip2long() works not as documented
| From: | vrana@php.net | Date: | Thu, 19 Aug 2004 13:30:55 +0000 |
| Subject: | #29737 [Opn]: ip2long() works not as documented | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969363360@lists.php.net to get a copy of this message | ||
ID: 29737
Updated by: vrana@php.net
Reported By: belikoviv at is dot lg dot ua
Status: Open
Bug Type: Documentation problem
Operating System: Windows 2000 SP4; Fedora Core 2
PHP Version: 5.0.0
New Comment:
http://www.php.net/Changelog-5.php#5.0.0RC3 :
Fixed ip2long() to return FALSE if an IP address passed to this
function is not valid. (Derick).
The function really returns FALSE for 255.255.255.255 and for invalid
addresses and this is what is documented. If it's not correct, change
this bug to Network related, fix the source and then change it back to
Documentation problem.
If the behavior is correct, leave the bug closed.
Previous Comments:
------------------------------------------------------------------------
[2004-08-19 15:19:33] derick@php.net
Also a duplicate of #25487.
The function should NEVER return FALSE, but it should return -1 for
255.255.255.255; if it does not do this, or it is not documented as
such. The bug is open.
------------------------------------------------------------------------
[2004-08-19 14:59:00] tony2001@php.net
This is already documented and the function works as the documentation
states. If you don't like how it was implemented, you are free to send
a patch and/or to open a feature request. This is not a bug.
------------------------------------------------------------------------
[2004-08-19 14:54:37] belikoviv at is dot lg dot ua
just see my previous comment
------------------------------------------------------------------------
[2004-08-19 10:47:57] belikoviv at is dot lg dot ua
I think that problem not in documentation, but in function itself.
Address 255.255.255.255 is _valid_ address, and function must return
0xffffffff (-1), not FALSE.
In versions before 5.0 ip2long was return -1 in both situations - as
error and in case of addres=255.255.255.255. This is not good solution,
and, as I think, authors rewrite function to return FALSE in case of
invalid IP and return -1 in case of IP=255.255.255.255. And this
behavior of function was written in documentation, so documentation
_is_ correct.
Sorry for so many words in bad English :(
------------------------------------------------------------------------
[2004-08-19 07:57:24] tony2001@php.net
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
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