Non-complete IP addresses and ip2long()
<p>I stubled upon following question:</p>

<p>"What is the output of the following code?"</p>

<pre><code>echo long2ip(ip2long("127.0.255"));
</code></pre>

<p>The correct answer is: "127.0.255.0".</p>

<p>While it seems logical as this behavior is mentioned in the <a href="http://de1.php.net/manual/en/function.ip2long.php" rel="nofollow">php manual</a> and has even an example in the <a href="http://de1.php.net/manual/de/function.ip2long.php" rel="nofollow">german manual</a>, I have my issues reproducing it.</p>

<p>My code produces following outputs:</p>

<pre><code>echo ip2long("127.0.255"); // outputs: FALSE
echo long2ip(ip2long("127.0.255")); //outputs: 0.0.0.0
</code></pre>

<p>The machine I tested this on has following software versions:</p>

<ul>
<li>PHP 5.3.3-7+squeeze15 with Suhosin-Patch</li>
<li>Suhosin Patch 0.9.9.1</li>
</ul>

<p>None of my colleagues could give me a precise explanation.
The only assumption we have is, that it could be a conflict with the Suhosin-Patch.</p>

<p>If you have an explanation, please let me know.</p>
