3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php var_dump(bin2hex(inet_pton('2001:0db8:85a3:08d3:1319:8a2e:0370:7344'))); var_dump(bin2hex(inet_pton('::1'))); var_dump(bin2hex(inet_pton('127.0.0.1')), bin2hex(inet_pton('::127.0.0.1')), bin2hex(inet_pton('::0001'), , bin2hex(inet_pton('::1'))); $ipHex = bin2hex(inet_pton('127.0.0.1')); $ipHex = (strlen($ipHex) == 8) ? '000000000000000000000000' . $ipHex : $ipHex; var_dump("SELECT 1 FROM IPv6Ranges WHERE X'" . $ipHex . "' BETWEEN `start` AND `end`");
Output for 5.3.0 - 5.4.21
Parse error: syntax error, unexpected ',' in /in/Ec8sQ on line 5
Process exited with code 255.