php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #67066 Incorrect documentation for 'long2ip'
Submitted: 2014-04-13 17:58 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:58 UTC] bsasser at sindtech dot net
Description:
------------
---
From manual page: http://www.php.net/function.long2ip (specifically http://us2.php.net/manual/en/function.long2ip.php )
---

This has similar issues to he ones I just submitted for ip2long.

1) First line states:
"long2ip — Converts an (IPv4) Internet network address into a string in Internet standard dotted format"

It "converts an (IPv4) Internet network address into a string in Internet standard dotted format"?  What's the point of converting it to what we already have?  (BTW it is "Dotted Quad Notation" and/or "Dotted Decimal Notation").

This line makes no sense.  It should say something like "Converts a long integer to an IPv4 network address in Dotted Quad Notation."

2) Description states:
string long2ip ( string $proper_address )

$proper_address is incorrect.  You don't pass it an IPv4 address to get an IPv4 address, you pass it a long integer.  The statement underneath incorrectly states:
"The function long2ip() generates an Internet address in dotted format (i.e.: aaa.bbb.ccc.ddd) from the proper address representation. "

Again, this makes no sense.  Why convert it from 'the proper address representation' to 'an Internet address'?  See #1 above for more clarity.

3) Parameter states:
"proper_address

    A proper address representation."

See #2.  You don't pass it a "proper address" so it can return a "proper address", you pass it a long integer.



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

Expected result:
----------------
Technically accurate documentation.

Actual result:
--------------
What appears to be late night editing of documentation.

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 11:01:31 2024 UTC