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, ), ) ); $count = array_sum(array_column($prices['options'], 'count')); $minmax = array_map( function($option){ $split=explode('_',$option['value']); return [(int)$split[0],(int)$split[1]]; }, $prices['options'] ); $min=min(array_column($minmax,0)); $max=max(array_column($minmax,1)); $prices['options'] = [ 'label' => $min . '-' . $max, 'value' => $min . '_' . $max, 'count' => $count ]; echo print_r($prices,true);

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.0130.00516.97
8.5.60.0040.00616.82
8.5.50.0120.00616.69
8.5.30.0090.00817.21
8.5.20.0090.00819.64
8.5.10.0100.00816.76
8.5.00.0110.01120.05
8.4.180.0100.01219.60
8.4.170.0130.00724.04
8.4.160.0110.01023.83
8.4.150.0080.00516.84
8.4.140.0110.00917.87
8.4.130.0110.01017.64
8.4.120.0150.00620.83
8.4.110.0120.01022.38
8.4.100.0120.00817.96
8.4.90.0070.00424.32
8.4.80.0080.00218.61
8.4.70.0170.00518.12
8.4.60.0110.00918.65
8.4.50.0120.00820.34
8.4.40.0160.00317.79
8.4.30.0160.00320.48
8.4.20.0060.01619.78
8.4.10.0040.00417.88
8.3.300.0110.00921.06
8.3.290.0120.01020.71
8.3.280.0060.00318.44
8.3.270.0110.00916.13
8.3.260.0090.01016.54
8.3.250.0120.00718.70
8.3.240.0140.00616.55
8.3.230.0090.00816.91
8.3.220.0120.00619.08
8.3.210.0140.00516.68
8.3.200.0040.00516.60
8.3.190.0110.00717.27
8.3.180.0120.00617.25
8.3.170.0160.00320.78
8.3.160.0110.00717.45
8.3.150.0040.00416.86
8.3.140.0040.00416.57
8.3.130.0000.01116.40
8.3.120.0040.00420.67
8.3.110.0040.00420.94
8.3.100.0090.00018.19
8.3.90.0070.01126.77
8.3.80.0090.00316.75
8.3.70.0210.00016.75
8.3.60.0040.01416.50
8.3.50.0170.00019.90
8.3.40.0120.00319.03
8.3.30.0040.01118.70
8.3.20.0050.00224.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.300.0140.00722.29
8.2.290.0040.00422.05
8.2.280.0120.00718.42
8.2.270.0130.00617.11
8.2.260.0080.00016.61
8.2.250.0160.00318.37
8.2.240.0040.00417.18
8.2.230.0050.00522.58
8.2.220.0030.00724.06
8.2.210.0030.00626.77
8.2.200.0040.00416.88
8.2.190.0140.00716.88
8.2.180.0120.01225.92
8.2.170.0070.00719.01
8.2.160.0100.00322.96
8.2.150.0070.00025.66
8.2.140.0060.00324.66
8.2.130.0030.00626.16
8.2.120.0070.00026.16
8.2.110.0110.00019.21
8.2.100.0040.00819.64
8.2.90.0040.00419.17
8.2.80.0040.00417.97
8.2.70.0050.00317.63
8.2.60.0070.00717.93
8.2.50.0040.00418.07
8.2.40.0040.00419.78
8.2.30.0040.00417.70
8.2.20.0040.00418.32
8.2.10.0040.00418.96
8.2.00.0000.00819.36
8.1.340.0130.00717.70
8.1.330.0110.00722.23
8.1.320.0150.00416.16
8.1.310.0120.00318.33
8.1.300.0130.00316.17
8.1.290.0060.00330.84
8.1.280.0170.00325.92
8.1.270.0060.00323.99
8.1.260.0040.00426.35
8.1.250.0100.01028.09
8.1.240.0060.00323.92
8.1.230.0110.00017.58
8.1.220.0040.00417.76
8.1.210.0000.00918.77
8.1.200.0030.00617.47
8.1.190.0040.00417.22
8.1.180.0000.00818.10
8.1.170.0050.00318.75
8.1.160.0040.00418.82
8.1.150.0000.00818.73
8.1.140.0090.00017.37
8.1.130.0070.00018.90
8.1.120.0050.00217.47
8.1.110.0040.00417.43
8.1.100.0070.00017.36
8.1.90.0000.00717.38
8.1.80.0070.00017.52
8.1.70.0030.00317.48
8.1.60.0000.00717.60
8.1.50.0090.00017.54
8.1.40.0020.00517.51
8.1.30.0030.00617.60
8.1.20.0080.00017.64
8.1.10.0000.00817.61
8.1.00.0070.00017.37
8.0.300.0000.00718.77
8.0.290.0040.00416.58
8.0.280.0030.00318.36
8.0.270.0000.00716.73
8.0.260.0060.00018.37
8.0.250.0000.00716.93
8.0.240.0040.00416.86
8.0.230.0060.00316.99
8.0.220.0000.00716.95
8.0.210.0000.00716.96
8.0.200.0070.00216.92
8.0.190.0040.00417.00
8.0.180.0040.00416.96
8.0.170.0000.00816.98
8.0.160.0030.00316.93
8.0.150.0000.00816.76
8.0.140.0000.00716.74
8.0.130.0030.00313.33
8.0.120.0000.00816.84
8.0.110.0030.00616.89
8.0.100.0000.00816.95
8.0.90.0040.00416.78
8.0.80.0040.00416.76
8.0.70.0020.00516.88
8.0.60.0000.00816.72
8.0.50.0000.00716.84
8.0.30.0050.00316.88
8.0.20.0040.00416.85
8.0.10.0030.00517.08
8.0.00.0070.00016.86
7.4.330.0040.00415.55
7.4.320.0000.00616.50
7.4.300.0000.00616.41
7.4.290.0050.00216.41
7.4.280.0000.00716.60
7.4.270.0040.00416.50
7.4.260.0030.00313.29
7.4.250.0080.00016.53
7.4.240.0040.00416.67
7.4.230.0000.00816.64
7.4.220.0070.00016.40
7.4.210.0000.00716.68
7.4.200.0040.00416.62
7.4.190.0000.00816.73
7.4.180.0030.00316.71
7.4.160.0070.00016.66
7.4.150.0000.00816.39
7.4.140.0060.00316.54
7.4.130.0070.00016.50
7.4.120.0040.00416.50
7.4.110.0050.00316.57
7.4.100.0000.00916.33
7.4.90.0000.00716.29
7.4.80.0050.00316.37
7.4.70.0020.00516.34
7.4.60.0030.00316.54
7.4.50.0000.00816.24
7.4.40.0030.00316.22
7.4.30.0060.00016.34
7.4.20.0030.00316.56
7.4.10.0000.00816.58
7.4.00.0080.00016.41
7.3.330.0000.00716.38
7.3.320.0030.00313.37
7.3.310.0030.00316.33
7.3.300.0030.00316.38
7.3.290.0000.00616.36
7.3.280.0000.00716.23
7.3.270.0000.00716.37
7.3.260.0040.00416.40
7.3.250.0020.00516.28
7.3.240.0070.00016.41
7.3.230.0000.00716.37
7.3.220.0040.00416.30
7.3.210.0030.00316.23
7.3.200.0000.00716.31
7.3.190.0070.00016.32
7.3.180.0070.00016.19
7.3.170.0030.00316.26
7.3.160.0000.00716.30
7.3.150.0030.00516.34
7.3.140.0000.00716.31
7.3.130.0070.00016.17
7.3.120.0040.00416.13
7.3.110.0000.00716.20
7.3.100.0040.00416.23
7.3.90.0000.00616.43
7.3.80.0050.00216.18
7.3.70.0030.00316.27
7.3.60.0000.00616.30
7.3.50.0070.00016.35
7.3.40.0070.00016.44
7.3.30.0000.00716.46
7.3.20.0070.00018.30
7.3.10.0000.00718.27
7.3.00.0000.00718.14

preferences:
58.93 ms | 1431 KiB | 5 Q