php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #67065 Incorrect documentation for 'ip2long'
Submitted: 2014-04-13 17:50 UTC Modified: 2014-04-17 06:50 UTC
From: bsasser at sindtech dot net Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: n/a
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bsasser at sindtech dot net
New email:
PHP Version: OS:

 

 [2014-04-13 17:50 UTC] bsasser at sindtech dot net
Description:
------------
---
From manual page: http://www.php.net/function.ip2long (specifically http://us2.php.net/manual/en/function.ip2long.php )
---

1) The first line incorrectly states:
"ip2long — Converts a string containing an (IPv4) Internet Protocol dotted address into a proper address"

This function is to convert IPv4 address to long integers (hence the name - 'ip2long').  The incorrect statement above applies to long2ip().


2) The Description correctly shows:
int ip2long ( string $ip_address )

The statement under the above incorrectly shows:
"The function ip2long() generates an IPv4 Internet network address from its Internet standard format (dotted string) representation."

That is not the purpose of this function (see #1).


3) Under Parameters it states:
"ip_address

    A standard format address."

which is correct.

Under Return Values it states:
"Returns the IPv4 address or FALSE if ip_address is invalid."

which is incorrect.

It is not what this function does (see #1).

Test script:
---------------
n/a

Expected result:
----------------
Technically accurate documentation ;-)

Actual result:
--------------
What looks like document editing done late at night.  See Description.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-04-17 06:50 UTC] krakjoe@php.net
-Status: Open +Status: Not a bug
 [2014-04-17 06:50 UTC] krakjoe@php.net
You seem to be incorrectly under the impression that IPv4 somehow means dotted address; it does not.

There is nothing wrong with the descriptions of these functions, they behave as they are documented; you simply misunderstood the documentation.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 06:01:32 2024 UTC