3v4l.org

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