3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $ip = gethostbyname ( 'www.example.com' ); $long = ip2long ( $ip ); if ( $long == - 1 || $long === FALSE ) { echo 'Invalid IP, please try again' ; } else { echo $ip . "\n" ; // 192.0.34.166 echo $long . "\n" ; // -1073732954 printf ( "%u\n" , ip2long ( $ip )); // 3221234342 }
Output for 4.3.5 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Invalid IP, please try again
Output for 4.3.0 - 4.3.4
www.example.com 4294967295 4294967295