3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function cidrlist($cidr) { $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)){ array_push($ips,$ip); } $fip++; } return $ips; } $nblock = cidrlist('0.0.0.0/0'); print_r($nblock);
Output for 7.0.0 - 7.1.0
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 33554440 bytes) in /in/E18gU on line 14
Process exited with code 255.
Output for hhvm-3.12.0
mallctl opt.prof: No such file or directory (2) Fatal error: request has exceeded memory limit in /in/E18gU on line 11
Process exited with code 255.
Output for hhvm-3.10.0
Fatal error: request has exceeded memory limit in /in/E18gU on line 11
Process exited with code 255.
Output for 5.5.0 - 5.6.28
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 72 bytes) in /in/E18gU on line 14
Process exited with code 255.
Output for 5.3.0 - 5.4.45
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 32 bytes) in /in/E18gU on line 13
Process exited with code 255.
Output for 5.2.10 - 5.2.17
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 24 bytes) in /in/E18gU on line 13
Process exited with code 255.
Output for 5.2.6 - 5.2.9
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 71 bytes) in /in/E18gU on line 14
Process exited with code 255.
Output for 5.2.5
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 8 bytes) in /in/E18gU on line 13
Process exited with code 255.
Output for 4.3.5 - 5.2.4
Array ( )
Output for 4.3.0 - 4.3.4

Process exited with code 137.