3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = bin2hex(inet_pton('2001:cdba:0000:0000:0000:0000:3257:9652')); echo $a, PHP_EOL; echo inet_ntop(hex2bin($a)), PHP_EOL; echo bin2hex(inet_pton('127.0.0.1')), PHP_EOL;
Output for 5.4.0 - 7.2.0
2001cdba000000000000000032579652 2001:cdba::3257:9652 7f000001
Output for 5.1.0 - 5.3.29
2001cdba000000000000000032579652 Fatal error: Call to undefined function hex2bin() in /in/8q6L1 on line 4
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function inet_pton() in /in/8q6L1 on line 2
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: inet_pton() in /in/8q6L1 on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: inet_pton() in /in/8q6L1 on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: inet_pton() in /in/8q6L1 on line 2