ID: 41946
User updated by: youare at loss4words dot com
Reported By: youare at loss4words dot com
Status: Open
Bug Type: Documentation problem
Operating System: Debian 4.0
-PHP Version: Irrelevant
+PHP Version: 5.1
New Comment:
Err, somehow it dropped my version out of the textfield through
successive CAPTCHAs and reloads. Anyway I'm using 5.1.
Previous Comments:
------------------------------------------------------------------------
[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