3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '[ { "id": "1", "country_id": "1", "spec_id": "1", "spec_children_name": "SUPER REDUCES RATE", "spec_children_first_col": "", "spec_children_second_col": "", "spec_children_third_col": "" }, { "id": "2", "country_id": "1", "spec_id": "1", "spec_children_name": "REDUCED RATE", "spec_children_first_col": "10% and 13%", "spec_children_second_col": "food, passenger transport, accommodotion, newspaper, pharmaceutical products,\u2026.(10%); plants, antiques, firewood, cinema, theatre,\u2026(13%)", "spec_children_third_col": "" }, { "id": "3", "country_id": "1", "spec_id": "1", "spec_children_name": "MEDIUM RATE", "spec_children_first_col": "", "spec_children_second_col": "", "spec_children_third_col": "" }, { "id": "4", "country_id": "1", "spec_id": "1", "spec_children_name": "STANDARD RATE", "spec_children_first_col": "20%", "spec_children_second_col": "other", "spec_children_third_col": "" }, { "id": "5", "country_id": "1", "spec_id": "1", "spec_children_name": "ZERO RATE", "spec_children_first_col": "", "spec_children_second_col": "", "spec_children_third_col": "" }, { "id": "104", "country_id": "2", "spec_id": "1", "spec_children_name": "REDUCED RATE", "spec_children_first_col": "TEXT 547", "spec_children_second_col": "TEXT 1000", "spec_children_third_col": "" } ]'; $objects = json_decode($json); $rules = ['spec_id' => 'ASC', 'spec_children_name' => 'DESC']; uasort($objects, function($a, $b) use ($rules) { foreach ($rules as $column => $order) { $left[] = $order === 'ASC' ? $a->$column : $b->$column; $right[] = $order === 'ASC' ? $b->$column : $a->$column; } return $left <=> $right; }); var_export($objects);

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.140.0120.00917.77
8.4.130.0100.01017.65
8.4.120.0100.00924.11
8.4.110.0040.00518.08
8.4.100.0080.01219.14
8.4.90.0110.00918.89
8.4.80.0090.00318.74
8.4.70.0150.00518.18
8.4.60.0110.01218.97
8.4.50.0110.01017.81
8.4.40.0000.00919.40
8.4.30.0030.00620.48
8.4.20.0000.00817.71
8.4.10.0030.01317.66
8.3.270.0110.00916.83
8.3.260.0140.00616.74
8.3.250.0140.00519.14
8.3.240.0100.00917.11
8.3.230.0100.00916.87
8.3.220.0070.00119.13
8.3.210.0070.00116.79
8.3.200.0080.00416.75
8.3.190.0110.00817.10
8.3.180.0060.00416.40
8.3.170.0130.00617.14
8.3.160.0130.00318.78
8.3.150.0100.01017.39
8.3.140.0050.00317.33
8.3.130.0040.00416.63
8.3.120.0060.00319.00
8.3.110.0090.00620.94
8.3.100.0080.00024.06
8.3.90.0070.00326.77
8.3.80.0030.00719.36
8.3.70.0150.00618.55
8.3.60.0090.00918.68
8.3.50.0110.00823.67
8.3.40.0090.00618.84
8.3.30.0090.00618.72
8.3.20.0090.00021.85
8.3.10.0030.00621.92
8.3.00.0050.00221.85
8.2.290.0080.01020.61
8.2.280.0110.00718.20
8.2.270.0110.00717.45
8.2.260.0040.00419.02
8.2.250.0150.00316.54
8.2.240.0060.00318.66
8.2.230.0030.00622.58
8.2.220.0040.00437.54
8.2.210.0080.00026.77
8.2.200.0090.00018.88
8.2.190.0090.00618.16
8.2.180.0170.00318.48
8.2.170.0110.00422.96
8.2.160.0090.00620.57
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0040.00419.65
8.2.110.0140.00720.54
8.2.100.0120.00319.45
8.2.90.0000.00917.63
8.2.80.0040.00418.76
8.2.70.0040.00417.75
8.2.60.0040.00418.05
8.2.50.0040.00418.07
8.2.40.0080.00018.17
8.2.30.0000.00718.04
8.2.20.0000.00818.03
8.2.10.0080.00019.24
8.2.00.0000.00719.38
8.1.330.0160.00221.94
8.1.320.0130.00616.12
8.1.310.0100.00718.65
8.1.300.0080.00020.03
8.1.290.0040.00430.84
8.1.280.0040.01125.92
8.1.270.0070.00323.82
8.1.260.0070.01326.35
8.1.250.0040.00428.09
8.1.240.0140.00319.06
8.1.230.0080.00417.77
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0060.00317.23
8.1.190.0060.00317.36
8.1.180.0040.00418.10
8.1.170.0060.00318.41
8.1.160.0060.00318.88
8.1.150.0050.00518.87
8.1.140.0000.00720.80
8.1.130.0000.00720.35
8.1.120.0000.00817.46
8.1.110.0040.00417.47
8.1.100.0050.00217.43
8.1.90.0070.00017.46
8.1.80.0000.00717.55
8.1.70.0040.00417.36
8.1.60.0080.00017.66
8.1.50.0050.00317.43
8.1.40.0030.00517.57
8.1.30.0000.00817.61
8.1.20.0040.00417.57
8.1.10.0040.00417.58
8.1.00.0050.00217.48
8.0.300.0000.00818.77
8.0.290.0030.00616.75
8.0.280.0030.00318.45
8.0.270.0000.00718.02
8.0.260.0000.00720.14
8.0.250.0080.00016.93
8.0.240.0030.00316.90
8.0.230.0000.00716.92
8.0.220.0060.00016.96
8.0.210.0000.00616.99
8.0.200.0030.00517.04
8.0.190.0070.00016.87
8.0.180.0040.00416.82
8.0.170.0060.00317.00
8.0.160.0050.00216.94
8.0.150.0080.00016.80
8.0.140.0000.00716.82
8.0.130.0030.00313.29
8.0.120.0090.00016.74
8.0.110.0040.00416.79
8.0.100.0040.00416.97
8.0.90.0040.00416.89
8.0.80.0070.00716.87
8.0.70.0040.00416.87
8.0.60.0040.00416.79
8.0.50.0040.00416.97
8.0.30.0030.01317.13
8.0.20.0070.01117.26
8.0.10.0040.00416.82
8.0.00.0090.00916.68
7.4.330.0000.00516.71
7.4.320.0030.00316.62
7.4.300.0000.00616.60
7.4.290.0000.00716.51
7.4.280.0040.00416.55
7.4.270.0030.00516.51
7.4.260.0030.00313.28
7.4.250.0040.00416.57
7.4.240.0040.00416.60
7.4.230.0030.00316.55
7.4.220.0030.00316.50
7.4.210.0070.00916.65
7.4.200.0070.00016.73
7.4.130.0100.01016.67
7.4.120.0090.01616.64
7.4.110.0130.00916.49
7.4.100.0000.01716.54
7.4.90.0120.00916.44
7.4.80.0080.00819.39
7.4.70.0040.01316.77
7.4.60.0080.00816.41
7.4.50.0130.00316.31
7.4.40.0080.00816.63
7.4.20.0130.00316.45
7.4.10.0040.01216.38
7.4.00.0110.00416.71
7.3.330.0040.00416.23
7.3.320.0000.00613.20
7.3.310.0050.00316.41
7.3.300.0000.00716.38
7.3.290.0000.00716.41
7.3.260.0200.00416.55
7.3.240.0070.01116.49
7.3.230.0050.01216.38
7.3.210.0160.00416.61
7.3.200.0120.00916.53
7.3.190.0140.00316.50
7.3.180.0080.00816.57
7.3.170.0000.01816.46
7.3.160.0140.00316.58
7.3.130.0040.01116.42
7.3.120.0120.00316.39
7.3.110.0060.00916.57
7.3.100.0000.01616.46
7.3.90.0030.01316.62
7.3.80.0110.00416.21
7.3.70.0070.01316.50
7.3.60.0100.00716.43
7.3.50.0090.00616.33
7.3.40.0150.00316.42
7.3.30.0120.00816.51
7.3.20.0140.00316.37
7.3.10.0060.01116.32
7.3.00.0110.00516.46
7.2.330.0170.00716.88
7.2.320.0060.01116.50
7.2.310.0130.00316.91
7.2.300.0100.01116.83
7.2.290.0090.01316.76
7.2.260.0070.00816.59
7.2.250.0090.00616.54
7.2.240.0000.01516.79
7.2.230.0040.01216.46
7.2.220.0080.00716.56
7.2.210.0100.00716.67
7.2.200.0070.01016.74
7.2.190.0080.00916.57
7.2.180.0090.00916.68
7.2.170.0030.01216.49
7.2.160.0070.01016.67
7.2.150.0000.01816.86
7.2.140.0080.00816.68
7.2.130.0140.00716.78
7.2.120.0110.00816.60
7.2.110.0030.01416.56
7.2.100.0030.01316.64
7.2.90.0050.01416.58
7.2.80.0110.00716.67
7.2.70.0160.00816.72
7.2.60.0120.01316.55
7.2.50.0040.01316.87
7.2.40.0110.00616.78
7.2.30.0140.00316.80
7.2.20.0160.00316.56
7.2.10.0140.01016.70
7.2.00.0030.01516.66

preferences:
34.03 ms | 403 KiB | 5 Q