From: ovdspek at liacs dot nl Operating system: Windows NT 4 SP 6 PHP version: 4.3.4 PHP Bug Type: Unknown/Other Function Bug description: ip2long("") = 0 intstead of -1
Description: ------------ ip2long returns 0 if the input is an empty string. However, an empty string is not valid, so it should return -1. "The function ip2long() generates an IPv4 Internet network address from its Internet standard format (dotted string) representation. If ip_address is invalid than -1 is returned. Note that -1 does not evaluate as FALSE in PHP." Reproduce code: --------------- <?php echo ip2long(""); ?> Expected result: ---------------- -1 Actual result: -------------- 0 -- Edit bug report at http://bugs.php.net/?id=26667&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26667&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26667&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=26667&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=26667&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=26667&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=26667&r=needscript Try newer version: http://bugs.php.net/fix.php?id=26667&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=26667&r=support Expected behavior: http://bugs.php.net/fix.php?id=26667&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=26667&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=26667&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=26667&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26667&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=26667&r=dst IIS Stability: http://bugs.php.net/fix.php?id=26667&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=26667&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=26667&r=float