ID: 41946 Updated by: [EMAIL PROTECTED] Reported By: youare at loss4words dot com Status: Open -Bug Type: Documentation problem +Bug Type: Network related Operating System: Debian 4.0 PHP Version: 5.1 New Comment:
ip2long should return -1 only for 255.255.255.255. Empty string should result in FALSE. Previous Comments: ------------------------------------------------------------------------ [2007-07-11 01:35:07] youare at loss4words dot com Err, somehow it dropped my version out of the textfield through successive CAPTCHAs and reloads. Anyway I'm using 5.1. ------------------------------------------------------------------------ [2007-07-10 07:19:00] youare at loss4words dot com Description: ------------ Documentation for ip2long needs a little more detail. It says that it returns FALSE if the argument passed is not a valid IP address, and says this returned -1 before version 5. It should also mention that if it is passed an empty argument that it will still return -1. Reproduce code: --------------- <?php echo "<br />Result: " . ip2long("10.10.10.10"); // returns long echo "<br />Result: " . ip2long("not.an.ip.address"); // returns FALSE echo "<br />Result: " . ip2long(""); // should return FALSE, returns -1 ?> Expected result: ---------------- Result: 168430090 Result: Result: Actual result: -------------- Result: 168430090 Result: Result: -1 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41946&edit=1