Re: Doc #55472 [Ana->Asn]ip2long(integer) returns integer
| From: | Laruence | Date: | Tue, 23 Aug 2011 02:57:26 +0000 |
| Subject: | Re: Doc #55472 [Ana->Asn]ip2long(integer) returns integer | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-54811@lists.php.net to get a copy of this message | ||
Hi:
well, seems we need win32 engineer to have look at this issue,
is there a chance that ip2long fall back to inet_addr() on windows?
if there is, it should be a bug :)
thanks
2011/8/22 <kalle@php.net>:
> laruence you have just been assigned to this bug by kalle@php.net
>
> Edit report at https://bugs.php.net/bug.php?id=55472&edit=1
>
> ID: 55472
> Updated by: kalle@php.net
> Reported by: php at linuxhosted dot ca
> Summary: ip2long(integer) returns integer
> -Status: Analyzed
> +Status: Assigned
> Type: Documentation Problem
> Package: *Network Functions
> Operating System: Windows
> PHP Version: 5.3.7
> -Assigned To:
> +Assigned To: laruence
> Block user comment: N
> Private report: N
>
> New Comment:
>
> (Ignore the assigned status laruence, just to notify you)
>
> We do have inet_ntop() + inet_pton() on Windows, see win32/inet.c which we implemented in 5.3
> so if thats the case that we fall back to inet_addr() on Windows its a bug as they are natively
> implemented.
>
> After it might be worth setting this bug to "To be documented" so the behaviour can
> indeed be noted if not already in the manual.
>
>
> Previous Comments:
> ------------------------------------------------------------------------
> [2011-08-21 10:10:40] laruence@php.net
>
> in the OS without inet_ntop, php ip2long use inet_addr handle the conversion,
> obviously there are difference between these two function when meet a not well-
> format numbers-and-dots notation.
>
> ß9ÛÝ&Z+ϣ�E‚
> N*http://www.kernel.org/doc/man-pages/online/pages/man3/inet_pton.3.html
>
> http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/libs/commtrf2/inet_addr.
> htm
>
> maybe the document should be more clearly to explain the difference?
>
> ------------------------------------------------------------------------
> [2011-08-21 03:09:36] php at linuxhosted dot ca
>
> Description:
> ------------
> On windows, the ip2long function does not return false on an invalid input, on other operating
> systems it properly returns false.
>
> Test script:
> ---------------
> var_dump(ip2long(26));
>
> Expected result:
> ----------------
> bool(false)
>
> Actual result:
> --------------
> int(26)
>
>
> ------------------------------------------------------------------------
>
>
>
> --
> Edit this bug report at https://bugs.php.net/bug.php?id=55472&edit=15
> 3Íuˆüýa�é>‹Ÿ£
>
--
Laruence Xinchen Hui
http://www.laruence.com/