#50873 [NEW]: Undocumented incompatible change in ip2long()

From: Date: Thu, 28 Jan 2010 10:56:02 +0000
Subject: #50873 [NEW]: Undocumented incompatible change in ip2long()
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-147030@lists.php.net to get a copy of this message
From: rthompson at mx dot itmedia dot co dot jp Operating system: Fedora PHP version: 5.2.12 PHP Bug Type: Network related Bug description: Undocumented incompatible change in ip2long() 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 bug report at http://bugs.php.net/?id=50873&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50873&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50873&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50873&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=50873&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50873&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=50873&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=50873&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=50873&r=needscript Try newer version: http://bugs.php.net/fix.php?id=50873&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=50873&r=support Expected behavior: http://bugs.php.net/fix.php?id=50873&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=50873&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=50873&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=50873&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50873&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=50873&r=dst IIS Stability: http://bugs.php.net/fix.php?id=50873&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=50873&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=50873&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=50873&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=50873&r=mysqlcfg

« previous php.bugs (#147030) next »