3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $ip_hex = (string) 0xC0A8071B; $ip_octet = long2ip($ip_hex); $ip_num = ip2long($ip_octet); echo 'IP Num: ', $ip_hex, PHP_EOL; echo 'Num -> Hex: ', dechex($ip_hex), PHP_EOL; echo 'IP Octet: ', $ip_octet, PHP_EOL; echo 'IP Num: ', $ip_num, PHP_EOL; echo 'Num -> Hex: ', dechex($ip_num), PHP_EOL;
based on QNAkD
Output for 4.3.10 - 4.4.9, 5.0.2 - 7.2.0
IP Num: 3232237339 Num -> Hex: c0a8071b IP Octet: 192.168.7.27 IP Num: 3232237339 Num -> Hex: c0a8071b
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
IP Num: 3232237339 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/6G8ek on line 5 PHP_EOLNum -> Hex: c0a8071b Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/6G8ek on line 6 PHP_EOLIP Octet: 192.168.7.27 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/6G8ek on line 7 PHP_EOLIP Num: 3232237339 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/6G8ek on line 8 PHP_EOLNum -> Hex: c0a8071b Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/6G8ek on line 9 PHP_EOL