#50873 [Opn->Tbd]: Undocumented incompatible change in ip2long()
| From: | jani@php.net | Date: | Thu, 28 Jan 2010 14:50:50 +0000 |
| Subject: | #50873 [Opn->Tbd]: Undocumented incompatible change in ip2long() | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-3796@lists.php.net to get a copy of this message | ||
ID: 50873
Updated by: jani@php.net
Reported By: rthompson at mx dot itmedia dot co dot jp
-Status: Open
+Status: To be documented
-Bug Type: Network related
+Bug Type: Documentation problem
Operating System: Fedora
PHP Version: 5.2.12
New Comment:
You're 4 releases too late with this. Invalid input == error == return
false.
Previous Comments:
------------------------------------------------------------------------
[2010-01-28 10:56:02] rthompson at mx dot itmedia dot co dot jp
Description:
------------
Through at least version 5.2.9, ip2long() returned the input value
unchanged for valid integer IP address inputs.
Since at least version 5.2.11, ip2long() returns "false" for all
integer IP address inputs. (5.2.12 and 5.2.11 tested, 5.2.10
untested).
Our application has been utilizing this function for the past three
years, originally deployed on 5.1.(6?). Since both string and long IP
addresses returned valid long results, the function returned valid
results regardless of the format. This is useful when importing from
data sources containing inconsistent representations.
The specification of the function's valid input and outputs has been
changed and made more restrictive, yet there is no changelog entry
documenting this incompatible change.
Reproduce code:
---------------
---
From manual page: function.ip2long#Changelog
---
echo ip2long("73.150.2.210");
echo ip2long(1234567890);
Expected result:
----------------
Expected return value (through 5.2.9) is the integer "1234567890" for
both inputs.
Actual result:
--------------
Actual return value (since 5.2.11 or .10) is "false" for the long
input,
correct for the string input.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50873&edit=1