3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ipv4Breakout ($ip_address, $ip_nmask) { $hosts = array(); //convert ip addresses to long form $ip_address_long = ip2long($ip_address); $ip_nmask_long = ip2long($ip_nmask); //caculate network address $ip_net = $ip_address_long & $ip_nmask_long; //caculate first usable address $ip_host_first = ((~$ip_nmask_long) & $ip_address_long); $ip_first = ($ip_address_long ^ $ip_host_first) + 1; //caculate last usable address $ip_broadcast_invert = ~$ip_nmask_long; $ip_last = ($ip_address_long | $ip_broadcast_invert) - 1; //caculate broadcast address $ip_broadcast = $ip_address_long | $ip_broadcast_invert; foreach (range($ip_first, $ip_last) as $ip) { array_push($hosts, $ip); } $block_info = array(array("network" => "$ip_net"), array("first_host" => "$ip_first"), array("last_host" => "$ip_last"), array("broadcast" => "$ip_broadcast"), $hosts); return $block_info; } print_r ipv4Breakout ('96.4.3.0', '255.255.255.0');

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.6.150.0070.04718.29
5.6.140.0070.04318.16
5.6.130.0070.04318.28
5.6.120.0030.05721.10
5.6.110.0070.07321.02
5.6.100.0170.06321.11
5.6.90.0100.06720.98
5.6.80.0030.07320.39
5.5.300.0130.08017.98
5.5.290.0100.08017.95
5.5.280.0000.07320.74
5.5.270.0100.06320.80
5.5.260.0100.03720.77
5.5.250.0130.07720.46
5.5.240.0000.04020.16

preferences:
146.58 ms | 1398 KiB | 7 Q