3v4l.org

run code in 300+ PHP versions simultaneously
<?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 git.master, rfc.property-hooks
Fatal error: Out of memory (allocated 31461376 bytes) (tried to allocate 16777224 bytes) in /in/E18gU on line 14 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for git.master_jit
Fatal error: Out of memory (allocated 16781312 bytes) (tried to allocate 8388616 bytes) in /in/E18gU on line 14 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
44.09 ms | 401 KiB | 8 Q