3v4l.org

run code in 300+ PHP versions simultaneously
<?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'), bin2hex(inet_pton('0000:0000:0000:0000:0000:0000:0000:0001'))); $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.3.27, 5.4.0 - 5.4.21
Parse error: syntax error, unexpected ';' in /in/kdXJO on line 5
Process exited with code 255.

preferences:
195.71 ms | 1386 KiB | 57 Q