#50873 [Com]: Undocumented incompatible change in ip2long()
| From: | rthompson at mx dot itmedia dot co dot jp | Date: | Fri, 29 Jan 2010 10:00:34 +0000 |
| Subject: | #50873 [Com]: Undocumented incompatible change in ip2long() | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-3802@lists.php.net to get a copy of this message | ||
ID: 50873
Comment by: rthompson at mx dot itmedia dot co dot jp
Reported By: rthompson at mx dot itmedia dot co dot jp
Status: To be documented
Bug Type: Documentation problem
Operating System: Fedora
PHP Version: 5.2.12
New Comment:
I'm know I'm a few releases late, but since the behavioral change isn't
documented anywhere it was difficult to understand what was going wrong
with the application.
I take it "To be documented" means there's a changelog entry coming?
Is it possible to add some clarification of the validity requirements
as
well?
Thank you!
Previous Comments:
------------------------------------------------------------------------
[2010-01-28 14:50:50] jani@php.net
You're 4 releases too late with this. Invalid input == error == return
false.
------------------------------------------------------------------------
[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