3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = Array ( 0 => Array ( 0 => 'Red', 1 => 'Steel' ), 1 => Array ( 0 => 'Red', 1 => 'Wood' ) , 2 => Array ( 0 => 'Blue', 1 => 'Wood' ) ); $colors = $materials = array(); foreach ($arr as $a){ $colors[] = $a[0]; $materials[] = $a[1]; } $colors = array_count_values($colors); $materials = array_count_values($materials); print_r($colors); print_r($materials);

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.0120.00918.31
8.3.50.0130.00723.01
8.3.40.0110.00418.67
8.3.30.0030.01018.89
8.3.20.0050.00220.21
8.3.10.0080.00021.72
8.3.00.0080.00017.80
8.2.180.0100.00316.63
8.2.170.0150.00618.90
8.2.160.0130.00722.96
8.2.150.0110.00425.66
8.2.140.0000.00824.66
8.2.130.0090.00626.16
8.2.120.0040.00421.02
8.2.110.0100.00021.12
8.2.100.0080.00417.85
8.2.90.0000.00819.38
8.2.80.0060.00317.97
8.2.70.0040.00417.49
8.2.60.0100.00717.67
8.2.50.0070.00318.07
8.2.40.0000.00818.10
8.2.30.0000.00718.13
8.2.20.0040.00417.73
8.2.10.0050.00617.84
8.2.00.0080.00417.60
8.1.280.0080.00825.92
8.1.270.0040.00424.66
8.1.260.0000.00828.09
8.1.250.0000.00828.09
8.1.240.0060.00620.88
8.1.230.0030.00817.82
8.1.220.0060.00317.88
8.1.210.0050.00318.77
8.1.200.0080.00317.22
8.1.190.0050.00317.10
8.1.180.0000.00718.10
8.1.170.0000.00818.58
8.1.160.0040.00422.05
8.1.150.0040.00418.92
8.1.140.0040.00517.41
8.1.130.0080.00517.32
8.1.120.0050.00417.42
8.1.110.0080.00417.40
8.1.100.0100.00417.41
8.1.90.0080.00617.44
8.1.80.0110.00217.44
8.1.70.0100.00417.40
8.1.60.0090.00617.55
8.1.50.0100.00517.51
8.1.40.0080.00417.47
8.1.30.0100.00517.56
8.1.20.0090.00617.62
8.1.10.0120.00217.43
8.1.00.0070.00517.57
8.0.300.0040.00418.77
8.0.290.0060.00316.63
8.0.280.0080.00018.43
8.0.270.0040.00616.75
8.0.260.0070.00616.74
8.0.250.0110.00316.74
8.0.240.0100.00316.80
8.0.230.0110.00216.83
8.0.220.0070.00716.75
8.0.210.0110.00316.79
8.0.200.0110.00216.81
8.0.190.0090.00416.69
8.0.180.0100.00416.75
8.0.170.0110.00316.68
8.0.160.0080.00616.79
8.0.150.0080.00516.61
8.0.140.0100.00416.67
8.0.130.0100.00315.86
8.0.120.0100.00416.66
8.0.110.0080.00416.69
8.0.100.0060.00716.68
8.0.90.0050.00916.74
8.0.80.0090.00516.78
8.0.70.0070.00516.74
8.0.60.0090.00316.66
8.0.50.0060.00616.73
8.0.30.0110.00616.80
8.0.20.0110.00516.97
8.0.10.0060.00616.83
8.0.00.0070.00616.81
7.4.330.0060.00416.01
7.4.320.0080.00716.46
7.4.300.0110.00616.41
7.4.290.0100.00516.35
7.4.280.0120.00416.37
7.4.270.0090.00616.49
7.4.260.0100.00416.43
7.4.250.0120.00416.41
7.4.240.0080.00416.44
7.4.230.0090.00316.40
7.4.220.0060.00616.43
7.4.210.0100.00316.50
7.4.200.0070.00516.48
7.4.190.0080.00416.56
7.4.180.0100.00316.49
7.4.160.0080.00516.56
7.4.150.0050.00816.62
7.4.140.0080.00716.87
7.4.130.0090.00516.42
7.4.120.0070.00716.35
7.4.110.0100.00416.42
7.4.100.0100.00716.47
7.4.90.0100.00616.42
7.4.80.0110.00516.79
7.4.70.0090.00716.43
7.4.60.0100.00516.47
7.4.50.0070.00716.37
7.4.40.0110.00616.35
7.4.30.0080.00716.46
7.4.20.0080.00616.45
7.4.10.0110.00516.22
7.4.00.0060.00915.86
7.3.330.0040.00615.52
7.3.320.0090.00415.54
7.3.310.0060.00616.32
7.3.300.0080.00416.30
7.3.290.0070.00516.25
7.3.280.0080.00616.31
7.3.270.0100.00416.52
7.3.260.0090.00616.28
7.3.250.0100.00616.30
7.3.240.0090.00516.35
7.3.230.0110.00316.34
7.3.220.0090.00716.31
7.3.210.0070.00816.30
7.3.200.0110.00616.68
7.3.190.0080.00716.32
7.3.180.0080.00716.39
7.3.170.0060.00816.37
7.3.160.0080.00716.41
7.3.150.0090.00516.30
7.3.140.0100.00516.37
7.3.130.0090.00516.09
7.3.120.0090.00715.87
7.3.110.0100.00615.99
7.3.100.0080.00815.84
7.3.90.0080.00715.88
7.3.80.0090.00615.82
7.3.70.0070.00715.79
7.3.60.0080.00615.89
7.3.50.0080.00615.82
7.3.40.0090.00715.88
7.3.30.0080.00815.81
7.3.20.0180.00616.80
7.3.10.0140.00616.70
7.3.00.0160.00616.67
7.2.340.0040.00616.36
7.2.330.0110.00416.50
7.2.320.0070.00816.38
7.2.310.0080.00816.42
7.2.300.0080.00816.50
7.2.290.0120.00416.52
7.2.280.0110.00416.45
7.2.270.0070.00816.42
7.2.260.0100.00516.31
7.2.250.0090.00816.18
7.2.240.0080.00716.19
7.2.230.0060.00916.02
7.2.220.0090.00715.99
7.2.210.0080.00716.02
7.2.200.0090.00616.05
7.2.190.0080.00716.05
7.2.180.0100.00616.04
7.2.170.0080.00716.10
7.2.160.0090.00616.19
7.2.150.0150.00817.00
7.2.140.0160.00716.97
7.2.130.0130.00717.03
7.2.120.0160.00617.00
7.2.110.0150.00816.97
7.2.100.0130.00717.01
7.2.90.0170.00816.96
7.2.80.0140.00716.97
7.2.70.0160.00716.99
7.2.60.0170.00616.86
7.2.50.0130.00716.79
7.2.40.0580.00716.83
7.2.30.0740.00816.92
7.2.20.0760.00716.84
7.2.10.0770.00716.83
7.2.00.0710.00717.16
7.1.330.0130.00516.38
7.1.320.0150.00416.17
7.1.310.0110.00616.07
7.1.300.0130.00516.11
7.1.290.0120.00716.08
7.1.280.0120.00716.08
7.1.270.0120.00816.06
7.1.260.0110.00816.13
7.1.250.0170.00815.86
7.1.240.0160.00715.85
7.1.230.0170.00515.83
7.1.220.0210.00615.91
7.1.210.0180.00715.86
7.1.200.0180.00515.87
7.1.190.0160.00915.83
7.1.180.0200.00515.86
7.1.170.0230.00515.64
7.1.160.0900.00715.93
7.1.150.0660.00615.97
7.1.140.0800.00615.96
7.1.130.0930.00615.98
7.1.120.0860.00815.92
7.1.110.0770.00915.91
7.1.100.0700.00816.06
7.1.90.0920.00815.87
7.1.80.0770.00715.93
7.1.70.0490.00615.91
7.1.60.0460.00717.47
7.1.50.0410.00717.46
7.1.40.0360.00617.35
7.1.30.0320.00717.36
7.1.20.0310.00917.37
7.1.10.0190.00515.89
7.1.00.0260.00715.81
7.0.330.0180.00615.55
7.0.320.0180.00515.61
7.0.310.0170.00715.55
7.0.300.1150.00515.29
7.0.290.0850.00615.59
7.0.280.0180.00515.54
7.0.270.1080.00915.60
7.0.260.0920.00615.60
7.0.250.0880.00715.66
7.0.240.0790.00815.68
7.0.230.0970.00615.64
7.0.220.0890.00615.66
7.0.210.0480.00715.54
7.0.200.0430.00615.70
7.0.190.0430.00615.59
7.0.180.0380.00715.60
7.0.170.0350.00615.58
7.0.160.0400.00715.54
7.0.150.0330.00715.50
7.0.140.0290.00615.51
7.0.130.0210.00615.58
7.0.120.0200.00615.61
7.0.110.0310.00715.55
7.0.100.0200.00715.51
7.0.90.0280.00615.50
7.0.80.0290.00815.47
7.0.70.0260.00615.52
7.0.60.0170.00815.46
7.0.50.0170.00615.52
7.0.40.0330.00715.50
7.0.30.0290.00715.51
7.0.20.0270.00815.39
7.0.10.0250.00715.42
7.0.00.0270.00515.40
5.6.400.0120.00815.83
5.6.390.0120.00615.85
5.6.380.0100.00915.62
5.6.370.0110.00815.66
5.6.360.0100.00815.73
5.6.350.0140.00515.77
5.6.340.0140.00615.82
5.6.330.0130.00615.71
5.6.320.0110.00815.77
5.6.310.0120.00815.76
5.6.300.0130.01616.61
5.6.290.0140.01416.57
5.6.280.0110.01916.64
5.6.270.0140.01616.62
5.6.260.0110.01716.60
5.6.250.0130.01416.60
5.6.240.0130.01716.61
5.6.230.0140.01716.54
5.6.220.0120.01616.59
5.6.210.0130.01716.62
5.6.200.0130.01616.64
5.6.190.0100.01916.59
5.6.180.0120.01516.63
5.6.170.0100.01816.64
5.6.160.0100.01916.64
5.6.150.0110.02116.65
5.6.140.0120.01616.66
5.6.130.0130.01416.61
5.6.120.0100.01616.64
5.6.110.0130.01816.57
5.6.100.0110.01716.56
5.6.90.0100.01616.60
5.6.80.0090.01916.53
5.6.70.0120.01416.47
5.6.60.0090.01716.52
5.6.50.0100.01616.41
5.6.40.0110.01716.42
5.6.30.0120.01416.46
5.6.20.0100.01816.45
5.6.10.0110.01716.47
5.6.00.0120.01816.43
5.5.380.0150.01415.69
5.5.370.0120.01515.66
5.5.360.0130.01415.68
5.5.350.0140.01515.74
5.5.340.0130.01615.79
5.5.330.0100.01815.76
5.5.320.0130.01615.81
5.5.310.0120.01715.80
5.5.300.0120.01415.79
5.5.290.0120.02115.71
5.5.280.0160.01415.74
5.5.270.0130.01715.74
5.5.260.0130.01615.79
5.5.250.0120.01615.70
5.5.240.0150.01615.66
5.5.230.0130.01315.61
5.5.220.0130.01715.67
5.5.210.0100.01915.65
5.5.200.0120.01515.60
5.5.190.0150.01515.65
5.5.180.0150.01415.65
5.5.170.0090.01015.22
5.5.160.0130.01515.62
5.5.150.0110.01715.67
5.5.140.0110.01815.61
5.5.130.0110.01715.60
5.5.120.0120.01515.67
5.5.110.0120.01615.57
5.5.100.0130.01415.62
5.5.90.0120.01515.63
5.5.80.0110.01515.67
5.5.70.0100.01515.70
5.5.60.0120.01515.65
5.5.50.0120.01715.55
5.5.40.0130.01615.60
5.5.30.0140.01315.61
5.5.20.0110.01615.66
5.5.10.0110.01515.63
5.5.00.0140.01715.56
5.4.450.0100.01514.70
5.4.440.0120.01514.65
5.4.430.0090.01814.71
5.4.420.0100.01414.71
5.4.410.0090.01614.70
5.4.400.0120.01414.62
5.4.390.0090.01414.55
5.4.380.0100.01514.55
5.4.370.0100.01714.57
5.4.360.0110.01514.64
5.4.350.0090.01714.62
5.4.340.0120.01214.62
5.4.330.0100.00613.65
5.4.320.0090.01614.63
5.4.310.0110.01414.63
5.4.300.0100.01514.62
5.4.290.0100.01314.58
5.4.280.0090.01514.65
5.4.270.0100.01314.60
5.4.260.0120.01414.64
5.4.250.0110.01614.62
5.4.240.0110.01214.59
5.4.230.0120.01314.62
5.4.220.0110.01514.58
5.4.210.0090.01714.62
5.4.200.0100.01614.63
5.4.190.0100.01314.57
5.4.180.0110.01314.59
5.4.170.0100.01514.61
5.4.160.0090.01514.60
5.4.150.0090.01714.60
5.4.140.0090.01614.22
5.4.130.0100.01414.21
5.4.120.0090.01514.18
5.4.110.0090.01614.17
5.4.100.0100.01214.17
5.4.90.0100.01314.17
5.4.80.0090.01414.19
5.4.70.0080.01914.17
5.4.60.0090.01714.17
5.4.50.0110.01314.19
5.4.40.0100.01314.20
5.4.30.0090.01514.18
5.4.20.0110.01614.16
5.4.10.0110.01314.20
5.4.00.0100.01214.10
5.3.290.0110.01213.95
5.3.280.0090.01613.88
5.3.270.0100.01313.88
5.3.260.0100.01613.89
5.3.250.0110.01213.90
5.3.240.0100.01313.80
5.3.230.0090.01513.88
5.3.220.0090.01913.84
5.3.210.0090.01713.87
5.3.200.0110.01213.81
5.3.190.0100.01313.91
5.3.180.0100.01513.93
5.3.170.0110.01513.92
5.3.160.0120.01413.89
5.3.150.0100.01513.94
5.3.140.0100.01413.88
5.3.130.0110.01513.91
5.3.120.0090.01613.89
5.3.110.0120.01413.90
5.3.100.0100.01513.86
5.3.90.0100.01613.88
5.3.80.0070.01513.81
5.3.70.0070.01713.84
5.3.60.0090.01413.79
5.3.50.0100.01213.82
5.3.40.0090.01413.82
5.3.30.0080.01613.80
5.3.20.0090.01213.74
5.3.10.0100.01413.71
5.3.00.0100.01413.71

preferences:
63.05 ms | 401 KiB | 5 Q