3v4l.org

run code in 500+ PHP versions simultaneously
<?php $prices = array( 'label' => 'Price', 'count' => 5, 'attribute_code' => 'price', 'options' => array( 0 => array( 'label' => '0-100', 'value' => '0_100', 'count' => 2208, ), 1 => array( 'label' => '100-200', 'value' => '100_200', 'count' => 338, ), 2 => array( 'label' => '200-300', 'value' => '200_300', 'count' => 16, ), 3 => array( 'label' => '300-400', 'value' => '300_400', 'count' => 1, ), 4 => array( 'label' => '400-500', 'value' => '400_500', 'count' => 1, ), ) ); $counts = array_sum(array_column($prices['options'], 'count')); $values = array_column($prices['options'], 'value'); array_multisort($values, SORT_ASC, SORT_NATURAL); $lowest = explode('_', $values[array_key_first($values)])[0]; $highest = explode('_', $values[array_key_last($values)])[1]; $prices['options'] = [ 'label' => $lowest . '-' . $highest, 'value' => $lowest . '_' . $highest, 'count' => $counts ]; var_export($prices['options']);

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.70.0100.00816.83
8.5.60.0090.00816.82
8.5.50.0110.00716.61
8.5.30.0090.00817.40
8.5.20.0140.00619.43
8.5.10.0110.00616.77
8.5.00.0130.00820.11
8.4.210.0140.00919.54
8.4.180.0110.01219.75
8.4.170.0130.00921.93
8.4.160.0120.00923.70
8.4.150.0060.00616.83
8.4.140.0100.01117.52
8.4.130.0150.00718.70
8.4.120.0150.00617.63
8.4.110.0130.00717.73
8.4.100.0170.00317.75
8.4.90.0070.00224.18
8.4.80.0130.00718.98
8.4.70.0080.01217.74
8.4.60.0140.00618.54
8.4.50.0120.00717.54
8.4.40.0150.00417.75
8.4.30.0100.01020.25
8.4.20.0140.00719.47
8.4.10.0090.00017.73
8.3.300.0120.00818.46
8.3.290.0120.00820.76
8.3.280.0140.00720.18
8.3.270.0120.00816.52
8.3.260.0100.00916.62
8.3.250.0120.00716.68
8.3.240.0110.00816.58
8.3.230.0100.00916.56
8.3.220.0050.00319.11
8.3.210.0110.00816.77
8.3.200.0060.00216.48
8.3.190.0110.00717.23
8.3.180.0100.00916.53
8.3.170.0080.00017.05
8.3.160.0000.01416.75
8.3.150.0120.00618.99
8.3.140.0060.00318.40
8.3.130.0080.00018.49
8.3.120.0080.00318.93
8.3.110.0070.00320.94
8.3.100.0090.00624.06
8.3.90.0070.01126.77
8.3.80.0070.00716.50
8.3.70.0110.00716.63
8.3.60.0120.00916.75
8.3.50.0070.00720.05
8.3.40.0040.01119.30
8.3.30.0110.00418.85
8.3.20.0040.00424.18
8.3.10.0080.00024.66
8.3.00.0040.00426.16
8.2.300.0110.00822.10
8.2.290.0100.00816.59
8.2.280.0110.00822.41
8.2.270.0150.00416.55
8.2.260.0070.00718.87
8.2.250.0130.00618.57
8.2.240.0150.00417.30
8.2.230.0040.00422.58
8.2.220.0070.00337.54
8.2.210.0040.00426.77
8.2.200.0030.00616.38
8.2.190.0150.00716.75
8.2.180.0150.00625.92
8.2.170.0130.00718.99
8.2.160.0150.00022.96
8.2.150.0070.00025.66
8.2.140.0000.00724.66
8.2.130.0080.00026.16
8.2.120.0040.00426.16
8.2.110.0090.00019.05
8.2.100.0000.01117.78
8.2.90.0090.00019.20
8.2.80.0050.00319.32
8.2.70.0000.01017.50
8.2.60.0060.00617.93
8.2.50.0000.00818.07
8.2.40.0000.00718.16
8.2.30.0050.00317.73
8.2.20.0050.00318.28
8.2.10.0020.00518.82
8.2.00.0050.00319.42
8.1.340.0110.01117.59
8.1.330.0100.01016.08
8.1.320.0160.00516.27
8.1.310.0070.01116.74
8.1.300.0030.01317.93
8.1.290.0060.00318.88
8.1.280.0060.01325.92
8.1.270.0040.00423.99
8.1.260.0000.00926.35
8.1.250.0110.00728.09
8.1.240.0030.00922.00
8.1.230.0070.00720.71
8.1.220.0060.00318.77
8.1.210.0070.00019.09
8.1.200.0090.00017.47
8.1.190.0040.00417.52
8.1.180.0040.00418.10
8.1.170.0040.00418.82
8.1.160.0040.00418.88
8.1.150.0050.00318.55
8.1.140.0000.00717.49
8.1.130.0040.00417.51
8.1.120.0000.00817.39
8.1.110.0060.00317.45
8.1.100.0070.00017.35
8.1.90.0000.00717.49
8.1.80.0040.00417.43
8.1.70.0070.00017.51
8.1.60.0030.00517.63
8.1.50.0030.00617.57
8.1.40.0040.00417.43
8.1.30.0040.00417.57
8.1.20.0040.00417.59
8.1.10.0040.00417.49
8.1.00.0040.00417.51
8.0.300.0040.00419.89
8.0.290.0070.00016.63
8.0.280.0040.00418.45
8.0.270.0030.00316.82
8.0.260.0000.00716.75
8.0.250.0000.00716.98
8.0.240.0040.00416.85
8.0.230.0030.00316.87
8.0.220.0000.00716.87
8.0.210.0030.00516.91
8.0.200.0040.00416.81
8.0.190.0060.00316.96
8.0.180.0070.00016.88
8.0.170.0060.00316.94
8.0.160.0000.00716.90
8.0.150.0000.00716.91
8.0.140.0000.00716.86
8.0.130.0030.00313.29
8.0.120.0080.00016.82
8.0.110.0040.00416.82
8.0.100.0080.00016.95
8.0.90.0050.00316.81
8.0.80.0060.00316.95
8.0.70.0080.00016.95
8.0.60.0030.00616.95
8.0.50.0000.01016.78
8.0.30.0030.00616.80
8.0.20.0000.01116.57
8.0.10.0000.00816.84
8.0.00.0040.00716.99
7.4.330.0000.00515.55
7.4.320.0060.00016.59
7.4.300.0000.00616.50
7.4.290.0090.00016.51
7.4.280.0040.00416.54
7.4.270.0000.00816.52
7.4.260.0000.00513.18
7.4.250.0030.00316.57
7.4.240.0000.01016.61
7.4.230.0070.00316.56
7.4.220.0040.00416.43
7.4.210.0060.00316.34
7.4.200.0080.00016.30
7.4.190.0000.00916.40
7.4.180.0040.00416.57
7.4.160.0000.00716.51
7.4.150.0000.00916.36
7.4.140.0030.00516.47
7.4.130.0000.00816.34
7.4.120.0040.00416.49
7.4.110.0030.00516.56
7.4.100.0000.00716.55
7.4.90.0070.00016.45
7.4.80.0000.00816.57
7.4.70.0030.00616.55
7.4.60.0040.00416.45
7.4.50.0000.00916.38
7.4.40.0040.00416.50
7.4.30.0000.01016.17
7.4.20.0030.00316.44
7.4.10.0030.00516.36
7.4.00.0050.00316.52
7.3.330.0060.00016.16
7.3.320.0030.00313.19
7.3.310.0080.00316.36
7.3.300.0000.00916.30
7.3.290.0040.00416.32
7.3.280.0030.00616.33
7.3.270.0030.00616.33
7.3.260.0000.00916.21
7.3.250.0030.00616.30
7.3.240.0090.00016.36
7.3.230.0030.00616.31
7.3.220.0050.00316.30
7.3.210.0050.00316.29
7.3.200.0060.00216.28
7.3.190.0060.00316.24
7.3.180.0030.00616.25
7.3.170.0000.00916.22
7.3.160.0060.00316.26
7.3.150.0000.01016.18
7.3.140.0050.00416.36
7.3.130.0060.00316.18
7.3.120.0000.00816.29
7.3.110.0000.00816.11
7.3.100.0000.00816.18
7.3.90.0040.00416.55
7.3.80.0040.00416.29
7.3.70.0030.00516.39
7.3.60.0030.00616.34
7.3.50.0040.00416.39
7.3.40.0060.00316.43
7.3.30.0060.00316.33
7.3.20.0030.00718.20
7.3.10.0060.00318.21
7.3.00.0030.00718.21

preferences:
37.79 ms | 1404 KiB | 5 Q