3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Capture the list of taste observations across analyses and phases of analysis $taste_observations = array(); // Temporary test data for Stack Overflow Question $taste_observations[] = [ 'analyst' => 'Ken', 'phase' => 'Entrance', 'taste' => 'Sweet', 'intensity' => 1 ]; $taste_observations[] = [ 'analyst' => 'Ken', 'phase' => 'Entrance', 'taste' => 'Spicy', 'intensity' => 1 ]; $taste_observations[] = [ 'analyst' => 'Ken', 'phase' => 'Center', 'taste' => 'Sweet', 'intensity' => 2 ]; $taste_observations[] = [ 'analyst' => 'Bob', 'phase' => 'Entrance', 'taste' => 'Savory', 'intensity' => 1 ]; $taste_observations[] = [ 'analyst' => 'Bob', 'phase' => 'After', 'taste' => 'Sweet', 'intensity' => 2, ]; $taste_summary = []; foreach($taste_observations as $taste_observation) { $taste_summary[$taste_observation['taste']] = [ 'taste' => $taste_observation['taste'], 'count' => 1 + ($taste_summary[$taste_observation['taste']]['count'] ?? 0), 'max' => max($taste_summary[$taste_observation['taste']]['max'] ?? 0, $taste_observation['intensity']), 'sum' => $taste_observation['intensity'] + ($taste_summary[$taste_observation['taste']]['sum'] ?? 0) ]; } ksort($taste_summary); $taste_summary = array_values($taste_summary); print_r($taste_summary);

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.120.0130.00620.46
8.4.110.0130.00722.39
8.4.100.0110.00917.81
8.4.90.0120.00818.52
8.4.80.0130.00718.56
8.4.70.0110.00518.54
8.4.60.0120.01118.75
8.4.50.0150.00819.49
8.4.40.0040.00419.54
8.4.30.0090.01020.08
8.4.20.0040.00417.90
8.4.10.0090.00020.39
8.3.250.0140.00618.79
8.3.240.0130.00816.70
8.3.230.0100.00916.37
8.3.220.0130.00719.18
8.3.210.0040.00316.78
8.3.200.0020.00716.62
8.3.190.0080.01016.92
8.3.180.0130.00616.68
8.3.170.0040.01419.01
8.3.160.0120.00320.04
8.3.150.0110.00717.37
8.3.140.0040.00416.66
8.3.130.0040.00418.65
8.3.120.0160.00019.08
8.3.110.0060.00320.94
8.3.100.0070.00324.06
8.3.90.0190.00026.77
8.3.80.0060.00318.43
8.3.70.0190.00316.63
8.3.60.0040.01118.27
8.3.50.0070.00718.30
8.3.40.0140.00722.16
8.3.30.0140.00019.17
8.3.20.0000.00724.18
8.3.10.0050.00324.66
8.3.00.0050.00226.16
8.2.290.0130.00620.68
8.2.280.0060.00318.60
8.2.270.0080.00017.16
8.2.260.0080.00019.19
8.2.250.0040.00418.36
8.2.240.0120.00317.42
8.2.230.0030.00622.58
8.2.220.0090.00037.54
8.2.210.0040.00426.77
8.2.200.0060.00316.38
8.2.190.0160.00016.58
8.2.180.0120.00925.92
8.2.170.0090.00919.09
8.2.160.0110.00422.96
8.2.150.0040.00425.66
8.2.140.0080.00024.66
8.2.130.0050.00226.16
8.2.120.0030.00519.80
8.2.110.0000.00922.06
8.2.100.0000.01119.57
8.2.90.0000.00817.75
8.2.80.0000.01018.63
8.2.70.0000.00719.28
8.2.60.0040.00417.50
8.2.50.0040.00417.63
8.2.40.0040.00417.63
8.2.30.0000.00718.01
8.2.20.0040.00420.47
8.2.10.0040.00418.17
8.2.00.0020.00519.30
8.1.330.0120.00721.88
8.1.320.0090.01016.05
8.1.310.0180.00018.20
8.1.300.0040.00417.66
8.1.290.0060.00330.84
8.1.280.0110.00725.92
8.1.270.0000.00823.99
8.1.260.0000.00826.35
8.1.250.0050.00228.09
8.1.240.0080.00420.35
8.1.230.0040.00817.70
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0080.00017.23
8.1.190.0080.00017.13
8.1.180.0000.00818.10
8.1.170.0040.00417.62
8.1.160.0030.00620.66
8.1.150.0000.00818.57
8.1.140.0080.00017.49
8.1.130.0030.00318.93
8.1.120.0000.00717.45
8.1.110.0050.00217.34
8.1.100.0050.00217.39
8.1.90.0030.00517.50
8.1.80.0000.00717.52
8.1.70.0000.00717.44
8.1.60.0030.00617.58
8.1.50.0000.00817.43
8.1.40.0240.00317.37
8.1.30.0180.00017.45
8.1.20.0150.00317.21
8.1.10.0140.00817.33
8.1.00.0190.00317.23
8.0.300.0070.00018.77
8.0.290.0000.00816.63
8.0.280.0070.00018.49
8.0.270.0050.00216.82
8.0.260.0040.00418.31
8.0.250.0030.00316.98
8.0.240.0030.00316.86
8.0.230.0000.00716.93
8.0.220.0050.00516.80
8.0.210.0030.00316.84
8.0.200.0030.00616.86
8.0.190.0000.00817.00
8.0.180.0040.00416.94
8.0.170.0170.00316.83
8.0.160.0150.00516.93
8.0.150.0130.00316.67
8.0.140.0190.00416.21
8.0.130.0170.00616.67
8.0.120.0110.00416.75
8.0.110.0040.01316.57
8.0.100.0160.00416.54
8.0.90.0110.00816.88
8.0.80.0110.00816.52
8.0.70.0120.01216.82
8.0.60.0180.00016.84
8.0.50.0150.00316.75
8.0.30.0130.00316.86
8.0.20.0060.01016.73
8.0.10.0130.00216.75
7.4.330.0050.00015.55
7.4.320.0000.00616.60
7.4.300.0000.00816.59
7.4.290.0030.00316.60
7.4.280.0120.00016.34
7.4.270.0150.00016.34
7.4.260.0130.00316.54
7.4.250.0090.00615.88
7.4.240.0200.00316.50
7.4.230.0170.00316.24
7.4.220.0060.00616.34
7.4.210.0100.00216.41
7.4.200.0070.00816.23
7.4.190.0130.00216.18
7.4.180.0120.01016.46
7.4.160.0150.00416.46
7.4.150.0100.00716.41
7.4.140.0110.00616.07
7.4.130.0120.00916.05
7.4.120.0180.00316.35
7.4.110.0150.00416.05
7.4.100.0180.00416.38
7.4.90.0090.00916.41
7.4.80.0210.00316.47
7.4.70.0160.00316.40
7.4.60.0130.00616.19
7.4.50.0090.00916.14
7.4.40.0100.00716.18
7.4.30.0150.00316.27
7.4.20.0040.01016.16
7.4.10.0100.00416.21
7.4.00.0100.00616.28

preferences:
29.32 ms | 403 KiB | 5 Q