#29737 [NEW]: ip2long() works not as documented
| From: | belikoviv at is dot lg dot ua | Date: | Wed, 18 Aug 2004 14:55:36 +0000 |
| Subject: | #29737 [NEW]: ip2long() works not as documented | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-64854@lists.php.net to get a copy of this message | ||
From: belikoviv at is dot lg dot ua
Operating system: Windows 2000 SP4; Fedora Core 2
PHP version: 5.0.0
PHP Bug Type: *Network Functions
Bug description: ip2long() works not as documented
Description:
------------
Documentation (from 16-08-2004) says:
"Note: ip2long() will return -1 for the IP 255.255.255.255"
Instead it returns FALSE.
Reproduce code:
---------------
#!/usr/local/bin/php
<?php
$ip = "255.255.255.255";
$long = ip2long ( $ip );// if ( $long === FALSE ) $long = -1;
echo $ip, "\t", $long, "\t", long2ip ( $long ), "\n";
?>
Expected result:
----------------
255.255.255.255 -1 255.255.255.255
Actual result:
--------------
255.255.255.255 0.0.0.0
--
Edit bug report at http://bugs.php.net/?id=29737&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29737&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29737&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=29737&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=29737&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29737&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=29737&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=29737&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=29737&r=support
Expected behavior: http://bugs.php.net/fix.php?id=29737&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=29737&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=29737&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=29737&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29737&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=29737&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=29737&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=29737&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29737&r=float