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)
8.3.60.0070.00716.63
8.3.50.0120.00917.91
8.3.40.0060.01218.92
8.3.30.0170.00318.79
8.3.20.0050.00320.29
8.3.10.0050.00323.66
8.3.00.0040.00419.26
8.2.180.0120.00916.88
8.2.170.0030.01022.96
8.2.160.0150.00322.14
8.2.150.0050.00324.18
8.2.140.0050.00324.66
8.2.130.0090.00317.50
8.2.120.0080.00026.35
8.2.110.0030.00721.16
8.2.100.0110.00017.78
8.2.90.0090.00019.07
8.2.80.0080.00017.97
8.2.70.0040.00417.63
8.2.60.0060.00317.90
8.2.50.0050.00318.07
8.2.40.0060.00319.48
8.2.30.0050.00220.57
8.2.20.0070.00317.61
8.2.10.0050.00318.12
8.2.00.0000.00718.00
8.1.270.0030.00622.17
8.1.260.0000.00728.09
8.1.250.0040.00428.09
8.1.240.0110.00722.50
8.1.230.0110.00020.96
8.1.220.0050.00217.74
8.1.210.0000.01019.10
8.1.200.0060.00617.35
8.1.190.0030.01017.36
8.1.180.0030.00518.10
8.1.170.0040.00418.50
8.1.160.0040.00421.98
8.1.150.0040.00420.71
8.1.140.0000.00819.49
8.1.130.0040.00417.71
8.1.120.0030.00517.37
8.1.110.0000.00717.46
8.1.100.0080.00017.45
8.1.90.0040.00417.50
8.1.80.0080.00317.43
8.1.70.0040.00417.47
8.1.60.0030.00517.62
8.1.50.0030.00617.56
8.1.40.0040.00417.60
8.1.30.0000.00817.73
8.1.20.0030.00617.72
8.1.10.0080.00017.61
8.1.00.0000.00717.55
8.0.300.0030.00319.90
8.0.290.0040.00416.75
8.0.280.0030.00318.46
8.0.270.0000.00717.25
8.0.260.0000.00617.27
8.0.250.0040.00417.01
8.0.240.0030.00317.04
8.0.230.0030.00317.01
8.0.220.0000.00817.01
8.0.210.0030.00317.04
8.0.200.0040.00417.00
8.0.190.0000.00816.99
8.0.180.0040.00417.05
8.0.170.0050.00216.96
8.0.160.0070.00017.03
8.0.150.0060.00316.95
8.0.140.0080.00016.77
8.0.130.0030.00313.37
8.0.120.0040.00416.95
8.0.110.0060.00316.93
8.0.100.0000.00816.82
8.0.90.0000.00816.94
8.0.80.0030.01316.85
8.0.70.0030.00616.97
8.0.60.0080.00016.86
8.0.50.0000.00817.02
8.0.30.0060.01317.02
8.0.20.0110.01017.44
8.0.10.0080.00017.08
8.0.00.0090.00816.84
7.4.330.0030.00315.10
7.4.320.0000.00616.54
7.4.300.0030.00316.65
7.4.290.0000.00716.58
7.4.280.0080.00016.65
7.4.270.0030.00316.64
7.4.260.0040.00416.64
7.4.250.0050.00316.42
7.4.240.0000.00816.64
7.4.230.0070.00016.58
7.4.220.0090.00916.61
7.4.210.0100.00616.66
7.4.200.0000.00716.77
7.4.160.0120.00316.58
7.4.150.0110.00817.40
7.4.140.0110.01017.86
7.4.130.0090.00816.63
7.4.120.0090.00816.56
7.4.110.0130.01016.34
7.4.100.0140.00616.70
7.4.90.0170.00016.64
7.4.80.0130.00319.39
7.4.70.0060.00916.56
7.4.60.0170.00316.73
7.4.50.0060.00316.52
7.4.40.0060.01816.55
7.4.30.0140.00816.48
7.4.10.0110.00714.94
7.4.00.0100.00814.98
7.3.330.0060.00013.43
7.3.320.0020.00213.36
7.3.310.0060.00316.29
7.3.300.0040.00416.29
7.3.290.0050.01016.42
7.3.280.0080.01116.42
7.3.270.0140.00417.40
7.3.260.0150.00916.48
7.3.250.0080.01216.50
7.3.240.0120.00616.53
7.3.230.0140.00416.59
7.3.210.0100.01016.45
7.3.200.0090.01416.61
7.3.190.0030.01316.52
7.3.180.0090.00916.48
7.3.170.0030.01316.59
7.3.160.0040.01216.65
7.3.130.0120.00615.12
7.3.120.0080.00815.00
7.3.110.0060.00914.81
7.3.100.0090.00515.00
7.3.90.0100.00514.88
7.3.80.0040.00614.93
7.3.70.0070.00614.92
7.3.60.0050.00814.78
7.3.50.0070.00714.65
7.3.40.0040.01114.91
7.3.30.0020.01114.90
7.3.20.0070.00716.82
7.3.10.0070.00616.62
7.3.00.0060.00816.64
7.2.330.0060.01116.92
7.2.320.0160.00016.94
7.2.310.0090.00916.90
7.2.300.0100.00716.64
7.2.290.0110.00716.57
7.2.260.0040.01414.99
7.2.250.0070.01014.92
7.2.240.0040.01115.08
7.2.230.0060.01215.20
7.2.220.0060.01015.22
7.2.210.0030.01015.17
7.2.200.0060.00915.10
7.2.190.0020.01215.10
7.2.180.0080.00815.18
7.2.170.0070.00615.18
7.2.160.0070.00815.08
7.2.150.0080.00616.98
7.2.140.0040.01016.89
7.2.130.0020.01217.04
7.2.120.0060.01016.99
7.2.110.0120.00616.63
7.2.100.0080.00617.07
7.2.90.0050.00916.92
7.2.80.0060.00817.13
7.2.70.0070.00516.87
7.2.60.0070.00716.99
7.2.50.0080.00416.99
7.2.40.0060.00917.12
7.2.30.0040.01117.09
7.2.20.0030.00816.96
7.2.10.0080.00917.01
7.2.00.0070.00817.79
7.1.330.0070.00715.96
7.1.320.0080.00515.82
7.1.310.0080.00515.66
7.1.300.0100.00415.85
7.1.290.0060.00815.71
7.1.280.0060.00615.80
7.1.270.0030.00915.83
7.1.260.0040.00915.73
7.1.250.0050.00915.74
7.1.240.0060.00615.88
7.1.230.0000.01415.89
7.1.220.0080.00015.79
7.1.210.0030.01015.83
7.1.200.0030.00715.86
7.1.190.0000.01315.71
7.1.180.0000.00915.84
7.1.170.0000.01315.70
7.1.160.0000.01215.68
7.1.150.0090.00015.79
7.1.140.0040.00815.76
7.1.130.0060.00315.97
7.1.120.0060.00615.89
7.1.110.0090.00915.89
7.1.100.0050.00516.94
7.1.90.0090.00415.74
7.1.80.0090.00616.11
7.1.70.0030.00616.54
7.1.60.0100.00517.70
7.1.50.0120.00225.24
7.1.40.0060.00315.29
7.1.30.0110.00015.71
7.1.20.0030.00515.93
7.1.10.0070.00715.46
7.1.00.0030.04419.21
7.0.330.0110.00715.52
7.0.320.0040.00815.61
7.0.310.0040.00815.54
7.0.300.0000.01315.18
7.0.290.0060.00315.33
7.0.280.0040.00415.55
7.0.270.0030.00915.61
7.0.260.0030.00915.61
7.0.250.0060.01215.63
7.0.240.0030.00515.42
7.0.230.0140.00015.35
7.0.220.0070.00415.56
7.0.210.0060.00315.59
7.0.200.0080.00715.31
7.0.190.0070.00315.33
7.0.180.0040.01115.37
7.0.170.0070.00415.53
7.0.160.0040.00715.64
7.0.150.0030.01215.62
7.0.140.0070.00715.45
7.0.130.0030.00515.59
7.0.120.0060.00315.27
7.0.110.0070.00715.41
7.0.100.0000.01215.59
7.0.90.0100.00315.59
7.0.80.0070.00315.32
7.0.70.0030.00915.40
7.0.60.0130.03417.73
7.0.50.0100.04016.82
7.0.40.0050.02516.79
7.0.30.0030.02816.79
7.0.20.0120.03416.95
7.0.10.0090.03116.93
7.0.00.0040.02216.94
5.6.400.0400.05778.97
5.6.390.0270.06179.00
5.6.380.0340.04179.19
5.6.370.0200.05379.31
5.6.360.0300.04378.64
5.6.350.0460.02979.05
5.6.340.0310.04478.80
5.6.330.0240.04779.04
5.6.320.0200.05079.04
5.6.310.0300.05178.86
5.6.300.0200.05979.09
5.6.290.0400.04778.98
5.6.280.0370.07982.29
5.6.270.0390.03679.07
5.6.260.0220.05478.80
5.6.250.0390.05279.09
5.6.240.0360.06279.12
5.6.230.0160.06579.19
5.6.220.0300.04778.82
5.6.210.0250.07182.17
5.6.200.0300.05381.07
5.6.190.0230.09282.08
5.6.180.0300.07781.85
5.6.170.0400.08081.96
5.6.160.0370.08581.95
5.6.150.0300.06280.89
5.6.140.0320.06280.94
5.6.130.0280.07580.82
5.6.120.0330.06782.28
5.6.110.0370.07882.38
5.6.100.0350.05282.31
5.6.90.0330.08582.28
5.6.80.0280.08982.06
5.6.70.0340.04478.88
5.6.60.0400.03479.13
5.6.50.0410.03478.91
5.6.40.0440.04479.05
5.6.30.0340.05779.06
5.6.20.0420.03978.78
5.6.10.0340.05179.07
5.6.00.0400.04778.99
5.5.380.0300.04678.82
5.5.370.0340.04478.67
5.5.360.0200.05779.21
5.5.350.2410.04682.14
5.5.340.0260.06480.74
5.5.330.0390.08581.73
5.5.320.0330.08682.02
5.5.310.0420.07281.80
5.5.300.0270.09080.75
5.5.290.0360.05780.79
5.5.280.0270.09282.19
5.5.270.0260.05982.34
5.5.260.0340.06982.20
5.5.250.0290.07782.12
5.5.240.0350.06281.98
5.5.230.0370.04778.90
5.5.220.0270.05078.94
5.5.210.0360.03979.09
5.5.200.0490.04678.77
5.5.190.0430.05078.94
5.5.180.0300.07478.72
5.5.170.0400.05678.81
5.5.160.0380.04178.77
5.5.150.0400.04078.96
5.5.140.0260.05278.86
5.5.130.0200.05878.77
5.5.120.0340.05478.59
5.5.110.0130.07978.94
5.5.100.0410.03478.73
5.5.90.0200.05878.80
5.5.80.0370.03778.56
5.5.70.0270.04879.00
5.5.60.0430.04678.82
5.5.50.0170.05979.14
5.5.40.0430.04978.70
5.5.30.0290.04679.04
5.5.20.0430.04378.88
5.5.10.0170.06379.03
5.5.00.0370.03479.19

preferences:
76.02 ms | 400 KiB | 5 Q