3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a=array('FA',12.9); $b=array('FA',12.9); $c=array('FB',12.2); $d=array('FC',12.3); $e=array('FA',12.9); $h=array('FA',12.4); $f=array('FB',12.9); $items=array($a,$b,$c,$d,$e,$f,$h); // Count in two different but functionally identical ways $counts_a = []; $counts_b = []; foreach($items as $item) { // Suppress the warning for missing key @$counts_a[$item[0] . ' ' . $item[1]]++; // Actually look for the key and set to zero if not found $key = $item[0] . ' ' . $item[1]; if(!array_key_exists($key, $counts_b)){ $counts_b[$key] = 0; } $counts_b[$key]++; } foreach($counts_a as $key => $count) { echo $key . 'x' . $count, PHP_EOL; }

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.4.140.0140.00817.79
8.4.130.0130.00817.57
8.4.120.0100.00820.67
8.4.110.0100.00720.43
8.4.100.0130.00817.80
8.4.90.0060.00318.15
8.4.80.0120.00817.96
8.4.70.0040.00517.70
8.4.60.0120.00324.25
8.4.50.0100.01022.67
8.4.40.0160.00318.64
8.4.30.0170.00318.87
8.4.20.0100.01018.08
8.4.10.0000.00922.11
8.3.270.0100.01117.05
8.3.260.0050.00416.73
8.3.250.0040.00518.99
8.3.240.0140.00916.85
8.3.230.0030.00616.82
8.3.220.0070.00217.12
8.3.210.0130.00716.75
8.3.200.0110.00818.61
8.3.190.0130.00617.12
8.3.180.0070.00918.83
8.3.170.0130.00617.12
8.3.160.0120.00618.76
8.3.150.0090.00917.07
8.3.140.0000.00816.82
8.3.130.0030.00718.83
8.3.120.0030.00618.87
8.3.110.0030.01220.94
8.3.100.0060.00316.68
8.3.90.0110.00026.77
8.3.80.0030.00616.63
8.3.70.0140.00016.61
8.3.60.0040.01518.68
8.3.50.0070.00720.45
8.3.40.0090.00619.79
8.3.30.0090.00618.87
8.3.20.0050.00324.18
8.3.10.0050.00324.66
8.3.00.0040.00426.16
8.2.290.0100.01020.21
8.2.280.0110.00916.68
8.2.270.0150.00417.12
8.2.260.0040.00419.05
8.2.250.0100.00016.95
8.2.240.0090.00017.38
8.2.230.0080.00022.58
8.2.220.0030.00624.06
8.2.210.0040.00426.77
8.2.200.0060.00318.42
8.2.190.0190.00016.75
8.2.180.0110.00425.92
8.2.170.0110.00422.96
8.2.160.0070.00722.96
8.2.150.0040.00425.66
8.2.140.0000.00824.66
8.2.130.0080.00026.16
8.2.120.0100.00326.16
8.2.110.0090.00020.93
8.2.100.0080.00317.97
8.2.90.0000.00819.39
8.2.80.0060.00317.97
8.2.70.0000.00917.88
8.2.60.0040.00417.93
8.2.50.0040.00418.07
8.2.40.0000.00820.00
8.2.30.0070.00018.01
8.2.20.0040.00419.37
8.2.10.0000.00718.13
8.2.00.0080.00318.88
8.1.330.0120.00616.84
8.1.320.0080.00716.49
8.1.310.0040.00416.64
8.1.300.0100.00617.84
8.1.290.0060.00330.84
8.1.280.0120.00625.92
8.1.270.0050.00324.66
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0060.00319.21
8.1.230.0070.00422.11
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0070.00317.35
8.1.190.0080.00017.22
8.1.180.0050.00318.10
8.1.170.0040.00418.46
8.1.160.0070.00018.77
8.1.150.0050.00218.54
8.1.140.0040.00417.37
8.1.130.0030.00318.94
8.1.120.0060.00417.49
8.1.110.0070.00017.43
8.1.100.0040.00417.35
8.1.90.0100.00517.34
8.1.80.0160.00017.31
8.1.70.0160.00017.45
8.1.60.0170.00017.47
8.1.50.0050.00917.47
8.1.40.0150.00317.50
8.1.30.0110.00717.63
8.1.20.0170.00317.66
8.1.10.0150.00317.63
8.1.00.0070.01117.43
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0030.00520.22
8.0.270.0030.00618.08
8.0.260.0030.00318.42
8.0.250.0030.00316.94
8.0.240.0000.00716.93
8.0.230.0040.00417.01
8.0.220.0100.00716.94
8.0.210.0100.00516.73
8.0.200.0120.00016.95
8.0.190.0130.00016.77
8.0.180.0060.00816.95
8.0.170.0160.00016.95
8.0.160.0110.00416.99
8.0.150.0090.00616.88
8.0.140.0120.00516.80
8.0.130.0070.00716.88
8.0.120.0080.00816.97
8.0.110.0120.00316.93
8.0.100.0140.00016.89
8.0.90.0150.00016.96
8.0.80.0100.00516.95
8.0.70.0090.00616.69
8.0.60.0090.00316.88
8.0.50.0100.00316.99
8.0.30.0130.00416.94
8.0.20.0160.00016.94
8.0.10.0120.00317.08
7.4.330.0000.00615.55
7.4.320.0060.00316.66
7.4.300.0060.00916.53
7.4.290.0090.00416.36
7.4.280.0090.00916.48
7.4.270.0190.00016.44
7.4.260.0120.00316.39
7.4.250.0170.00216.30
7.4.240.0180.00016.48
7.4.230.0150.00016.38
7.4.220.0100.00616.49
7.4.210.0080.00816.61
7.4.200.0080.00816.54
7.4.190.0050.00916.66
7.4.180.0060.00916.63
7.4.160.0150.00016.59
7.4.150.0140.00016.43
7.4.140.0050.00816.54
7.4.130.0090.00216.46
7.4.120.0110.00016.43
7.4.110.0100.00016.42
7.4.100.0120.00316.59
7.4.90.0000.00916.42
7.4.80.0060.00616.34
7.4.70.0000.01116.39
7.4.60.0050.00516.53
7.4.50.0090.00516.42
7.4.40.0040.00816.26
7.4.30.0000.00916.52
7.4.20.0110.00016.37
7.4.10.0040.00516.32
7.4.00.0050.00516.26

preferences:
30.23 ms | 403 KiB | 5 Q