3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [10, 20, 20, 10, 10, 30, 50, 10, 20]; $n = 9; $temp = array_count_values($arr); // count number of occurences $e = array_reduce($temp, function ($carry, $item) { $carry += ($item > 1 ? intval($item / 2) : 0); return $carry; }); echo $e;die;

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.5.10.0120.00716.60
8.5.00.0110.01219.92
8.4.150.0030.00014.05
8.4.140.0120.00917.54
8.4.130.0100.01017.83
8.4.120.0050.00322.35
8.4.110.0150.00622.43
8.4.100.0060.00417.97
8.4.90.0130.00717.71
8.4.80.0060.00419.53
8.4.70.0060.00817.89
8.4.60.0140.00818.89
8.4.50.0120.00818.48
8.4.40.0040.01119.27
8.4.30.0030.01620.53
8.4.20.0100.01020.90
8.4.10.0030.01719.54
8.3.280.0110.00918.49
8.3.270.0100.00916.60
8.3.260.0130.00716.64
8.3.250.0110.00918.81
8.3.240.0140.00618.68
8.3.230.0120.01016.69
8.3.220.0120.00616.87
8.3.210.0030.00518.59
8.3.200.0060.00316.64
8.3.190.0100.00817.11
8.3.180.0040.00516.89
8.3.170.0070.00717.40
8.3.160.0090.00918.48
8.3.150.0050.00320.88
8.3.140.0040.00419.00
8.3.130.0050.00318.46
8.3.120.0050.00518.91
8.3.110.0060.00320.94
8.3.100.0040.01118.50
8.3.90.0080.00026.77
8.3.80.0080.00416.75
8.3.70.0070.00718.31
8.3.60.0210.00018.55
8.3.50.0130.00417.52
8.3.40.0090.00619.02
8.3.30.0090.00618.85
8.3.20.0000.00820.90
8.3.10.0050.00318.85
8.3.00.0000.00721.90
8.2.290.0080.01120.38
8.2.280.0110.00820.26
8.2.270.0070.01117.27
8.2.260.0000.00816.38
8.2.250.0050.00316.71
8.2.240.0060.00316.95
8.2.230.0050.00222.58
8.2.220.0040.00424.06
8.2.210.0070.01026.77
8.2.200.0030.00618.26
8.2.190.0120.00916.63
8.2.180.0090.00625.92
8.2.170.0090.00622.96
8.2.160.0140.00020.11
8.2.150.0050.00524.18
8.2.140.0080.00024.66
8.2.130.0030.00626.16
8.2.120.0110.00420.92
8.2.110.0030.00619.52
8.2.100.0040.00817.84
8.2.90.0090.00017.50
8.2.80.0080.00018.92
8.2.70.0040.00417.50
8.2.60.0000.00817.63
8.2.50.0050.00318.10
8.2.40.0000.00919.49
8.2.30.0000.00719.25
8.2.20.0050.00318.12
8.2.10.0060.00318.87
8.2.00.0080.00019.37
8.1.330.0110.00823.73
8.1.320.0100.00918.03
8.1.310.0040.00416.56
8.1.300.0090.00018.53
8.1.290.0030.00830.84
8.1.280.0140.00025.92
8.1.270.0040.00420.75
8.1.260.0050.00326.35
8.1.250.0070.00728.09
8.1.240.0060.00323.91
8.1.230.0070.00422.75
8.1.220.0040.00418.52
8.1.210.0000.00819.16
8.1.200.0000.00917.35
8.1.190.0050.00317.35
8.1.180.0050.00318.10
8.1.170.0000.00818.65
8.1.160.0070.00019.00
8.1.150.0000.00718.67
8.1.140.0000.00718.80
8.1.130.0070.00020.16
8.1.120.0040.00417.42
8.1.110.0040.00417.42
8.1.100.0040.00417.34
8.1.90.0040.00417.39
8.1.80.0000.00817.35
8.1.70.0040.00417.37
8.1.60.0080.00017.63
8.1.50.0040.00417.52
8.1.40.0040.00417.40
8.1.30.0000.00817.54
8.1.20.0050.00317.54
8.1.10.0080.00017.46
8.1.00.0000.00717.45
8.0.300.0070.00020.04
8.0.290.0040.00416.75
8.0.280.0030.00318.34
8.0.270.0000.00717.98
8.0.260.0030.00518.43
8.0.250.0070.00017.02
8.0.240.0070.00016.91
8.0.230.0070.00016.91
8.0.220.0000.00716.88
8.0.210.0000.00716.93
8.0.200.0070.00016.98
8.0.190.0040.00417.03
8.0.180.0000.00717.02
8.0.170.0050.00316.98
8.0.160.0040.00417.04
8.0.150.0000.00716.88
8.0.140.0000.00716.78
8.0.130.0000.00713.36
8.0.120.0000.00716.81
8.0.110.0070.00017.01
8.0.100.0040.00416.95
8.0.90.0080.00016.81
8.0.80.0040.01116.91
8.0.70.0030.00616.80
8.0.60.0050.00317.04
8.0.50.0040.00416.89
8.0.30.0150.00417.01
8.0.20.0120.00617.40
8.0.10.0040.00417.01
8.0.00.0120.00516.81
7.4.330.0030.00315.55
7.4.320.0030.00316.49
7.4.300.0000.00616.44
7.4.290.0000.00716.60
7.4.280.0050.00316.55
7.4.270.0030.00316.50
7.4.260.0000.00716.58
7.4.250.0040.00416.45
7.4.240.0080.00016.49
7.4.230.0070.00016.58
7.4.220.0000.00816.57
7.4.210.0080.00716.51
7.4.200.0050.00216.61
7.4.140.0110.01117.86
7.4.130.0070.01116.59
7.4.120.0070.01016.44
7.4.110.0060.01016.59
7.4.100.0040.01316.64
7.4.90.0070.01016.57
7.4.80.0160.00319.39
7.4.70.0150.00616.58
7.4.60.0070.01016.55
7.4.50.0070.00716.33
7.4.40.0130.00316.56
7.4.00.0060.00614.96
7.3.330.0050.00013.38
7.3.320.0000.00613.28
7.3.310.0000.00616.47
7.3.300.0020.00516.31
7.3.290.0030.01016.42
7.3.280.0080.01216.43
7.3.260.0090.01116.47
7.3.240.0110.00816.54
7.3.230.0100.00716.46
7.3.210.0080.00816.64
7.3.200.0120.00616.58
7.3.190.0100.01316.67
7.3.180.0090.01416.48
7.3.170.0100.00716.68
7.3.160.0030.01416.66
7.3.50.0090.01314.83
7.3.40.0060.00914.50
7.3.30.0070.00714.68
7.3.20.0100.00316.82
7.3.10.0050.01016.85
7.3.00.0030.00816.87
7.2.330.0030.01416.70
7.2.320.0070.01416.46
7.2.310.0030.01416.77
7.2.300.0110.00616.58
7.2.290.0060.01416.59
7.2.180.0180.00615.11
7.2.170.0120.00914.75
7.2.160.0100.00314.84
7.2.150.0070.00717.00
7.2.140.0160.00616.84
7.2.130.0030.00916.96
7.2.120.0140.00016.94
7.2.110.0070.01616.71
7.2.100.0190.00316.62
7.2.90.0030.01117.10
7.2.80.0090.00316.82
7.2.70.0090.00917.02
7.2.60.0110.00316.96
7.2.50.0130.00016.78
7.2.40.0110.00016.83
7.2.30.0090.00316.75
7.2.20.0070.00716.75
7.2.10.0100.00316.70
7.2.00.0120.00017.01
7.1.280.0090.00315.88
7.1.270.0130.00015.96
7.1.260.0150.00615.98
7.1.250.0120.01015.75

preferences:
164.73 ms | 403 KiB | 5 Q