PHP 8.5.0 Alpha 4 available for testing

Voting

: max(seven, one)?
(Example: nine)

The Note You're Voting On

Karl Rixon
10 years ago
The manual states that "ip2long() will also work with non-complete IP addresses", however this is system-dependant so cannot be relied upon. For example, on my system ip2long() will return FALSE for incomplete addresses:

<?php
var_dump
(ip2long("255.255")); // bool(false)
?>

This is because ip2long will use inet_pton if available, which does not support non-complete addresses. If inet_pton is not available on your system, inet_addr will be used and incomplete addresses will work as stated.

<< Back to user notes page

To Top