3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $cidr = "127.0.0.1/20"; $rge = array(); $ips = array(); $cidr = explode('/', $cidr); $rge[0] = long2ip((ip2long($cidr[0])) & ((-1 << (32 - (int)$cidr[1])))); $rge[1] = long2ip((ip2long($cidr[0])) + pow(2, (32 - (int)$cidr[1])) - 1); $fip = ip2long($rge[0]); $lip = ip2long($rge[1]); $fip++; while($fip < $lip){ $ip = long2ip($fip); if(!preg_match('/\.0$/',$ip)){ echo "$ip\n"; } $fip++; } }
Output for 5.3.0 - 5.4.12
Parse error: syntax error, unexpected '}' in /in/KCP0h on line 19
Process exited with code 255.