#50873 [Tbd->Csd]: Undocumented incompatible change in ip2long()

From: Date: Wed, 17 Feb 2010 00:19:11 +0000
Subject: #50873 [Tbd->Csd]: Undocumented incompatible change in ip2long()
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-3912@lists.php.net to get a copy of this message
ID: 50873 Updated by: joey@php.net Reported By: rthompson at mx dot itmedia dot co dot jp -Status: To be documented +Status: Closed Bug Type: Documentation problem Operating System: Fedora PHP Version: 5.2.12 New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. Previous Comments: ------------------------------------------------------------------------ [2010-02-17 00:17:48] svn@php.net Automatic comment from SVN on behalf of joey Revision: http://svn.php.net/viewvc/?view=revision&revision=295189 Log: Add ChangeLog table entry to note when input parsing became more strict. Closes PHP Bug #50873. ------------------------------------------------------------------------ [2010-01-29 10:00:33] rthompson at mx dot itmedia dot co dot jp 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! ------------------------------------------------------------------------ [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

« previous php.doc.bugs (#3912) next »