Bug #55472 [Asn]: ip2long(integer) returns integer
| From: | php at linuxhosted dot ca | Date: | Tue, 23 Aug 2011 16:49:20 +0000 |
| Subject: | Bug #55472 [Asn]: ip2long(integer) returns integer | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-162871@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=55472&edit=1
ID: 55472
User updated by: php at linuxhosted dot ca
Reported by: php at linuxhosted dot ca
Summary: ip2long(integer) returns integer
Status: Assigned
Type: Bug
Package: *Network Functions
Operating System: Windows
PHP Version: 5.3.7
Assigned To: pajoye
Block user comment: N
Private report: N
New Comment:
Maybe you better take another look, and another read through the comments.
PHP 5.3 implemented these functions on windows:
look in win32/inet.c
Previous Comments:
------------------------------------------------------------------------
[2011-08-23 16:31:18] pajoye@php.net
There is no such function in Windows below Vista or Windows 7. So no, there is no
bug here but maybe in the WSAStringToAddress function.
------------------------------------------------------------------------
[2011-08-23 16:28:56] php at linuxhosted dot ca
As we've been saying, the fact that this function uses a Windows specific api is the bug. It
should be using inet_ntop/pton like every other OS does. Also, you say that "26" is a
valid IP, which is totally wrong, the function considers 26 to be "0.0.0.26", when if it
was taking it as a valid ip, it would mean that its "26.0.0.0, take for example,
long2ip(ip2long("10.200")); this becomes 10.0.0.200, instead of what it should be,
10.200.0.0.
Also, it makes no sense for a function that is not OS specific to have different results on
different platforms, PHP is supposed to be multi-platform, so except for functions that are meant to
be platform specific , functions shouldn't be giving a totally different result on different
platforms, it just makes no sense.
------------------------------------------------------------------------
[2011-08-23 16:16:53] pajoye@php.net
It is as it can be considered as valid IP and it is what happens on Windows, using
the underlying equivalent API.
That being said, I will double check again with the inent team at msft to be sure
that there is no bug in the API itself.
assigned to me.
------------------------------------------------------------------------
[2011-08-23 16:09:32] php at linuxhosted dot ca
pajoye, this is not a documentation bug
------------------------------------------------------------------------
[2011-08-23 15:10:29] php at linuxhosted dot ca
As kalle has said, this is not a documentation bug. The inet_ntop() and inet_pton() functions have
existed on Windows since 5.3
------------------------------------------------------------------------
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
https://bugs.php.net/bug.php?id=55472
--
Edit this bug report at https://bugs.php.net/bug.php?id=55472&edit=1