3v4l.org

run code in 300+ PHP versions simultaneously
<?php $testArray = [[ "lineupSet" => [ [[ "formula" => [ "totalPoints" => 214.61, ], "name" => "test1", ], [ "formula" => [ "totalPoints" => 201.17, ], "name" => "test2", ]], [ "formula" => [ "totalPoints" => 5.01, ], "name" => "test3", ]], ], [ "lineupSet" => [ [[ "formula" => [ "totalPoints" => 220.66, ], "name" => "test1", ], [ "formula" => [ "totalPoints" => 214.76, ], "name" => "test2", ]], ], ], [ "lineupSet" => [ [[ "formula" => [ "totalPoints" => 205.71, ], "name" => "test1", ], [ "formula" => [ "totalPoints" => 204.43, ], "name" => "test2", ]], ], ], [ "lineupSet" => [ [[ "formula" => [ "totalPoints" => 205.48, ], "name" => "test1", ], [ "formula" => [ "totalPoints" => 203.51, ], "name" => "test2", ]], ], ]]; function sum_points($v) { $totalPoints = 0; foreach ($v['lineupSet'] as $lset) { if (isset($lset['formula'])) { $totalPoints += $lset['formula']['totalPoints']; } else { foreach ($lset as $l) { $totalPoints += $l['formula']['totalPoints']; } } } return $totalPoints; } function sort_points($a, $b) { return sum_points($b) - sum_points($a); } usort($testArray, 'sort_points'); print_r($testArray[0]);

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.130.0160.00517.59
8.4.120.0090.01124.02
8.4.110.0120.00818.82
8.4.100.0130.00817.86
8.4.90.0110.00721.94
8.4.80.0140.00617.82
8.4.70.0110.00817.84
8.4.60.0100.01018.52
8.4.50.0060.00320.31
8.4.40.0170.00019.36
8.4.30.0000.01917.58
8.4.20.0130.00720.86
8.4.10.0080.00017.71
8.3.260.0030.00616.68
8.3.250.0090.00717.12
8.3.240.0110.00417.28
8.3.230.0150.00516.70
8.3.220.0050.00319.11
8.3.210.0070.00818.66
8.3.200.0070.00216.54
8.3.190.0070.00117.05
8.3.180.0040.00416.53
8.3.170.0070.01017.17
8.3.160.0130.00616.63
8.3.150.0110.00718.38
8.3.140.0090.00017.20
8.3.130.0140.00716.69
8.3.120.0000.00720.79
8.3.110.0170.00320.94
8.3.100.0090.00018.41
8.3.90.0070.01316.72
8.3.80.0060.00318.55
8.3.70.0130.00318.43
8.3.60.0070.01418.31
8.3.50.0120.00216.74
8.3.40.0030.01418.65
8.3.30.0150.00018.70
8.3.20.0080.00020.54
8.3.10.0080.00021.77
8.3.00.0040.00422.46
8.2.290.0080.01120.59
8.2.280.0030.00518.47
8.2.270.0040.00416.98
8.2.260.0080.00016.84
8.2.250.0120.00616.38
8.2.240.0060.00317.23
8.2.230.0110.00622.58
8.2.220.0100.00024.06
8.2.210.0050.00326.77
8.2.200.0060.00318.05
8.2.190.0070.00718.31
8.2.180.0100.00716.38
8.2.170.0100.01022.96
8.2.160.0060.00921.15
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0050.00221.07
8.2.110.0030.00622.02
8.2.100.0090.00317.84
8.2.90.0000.00917.84
8.2.80.0000.00817.97
8.2.70.0000.00818.03
8.2.60.0030.00618.03
8.2.50.0080.00018.10
8.2.40.0000.00719.23
8.2.30.0080.00019.25
8.2.20.0040.00418.18
8.2.10.0040.00419.22
8.2.00.0000.00818.13
8.1.330.0130.00622.03
8.1.320.0110.00815.96
8.1.310.0100.00718.32
8.1.300.0120.00315.91
8.1.290.0060.00618.88
8.1.280.0130.00725.92
8.1.270.0080.00020.19
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0120.00017.48
8.1.230.0080.00320.96
8.1.220.0000.00817.74
8.1.210.0090.00018.77
8.1.200.0060.00617.35
8.1.190.0030.00517.23
8.1.180.0030.00618.10
8.1.170.0040.00418.65
8.1.160.0050.00218.94
8.1.150.0040.00418.89
8.1.140.0070.00022.13
8.1.130.0070.00020.19
8.1.120.0000.00817.36
8.1.110.0030.00317.55
8.1.100.0000.00717.46
8.1.90.0000.01017.39
8.1.80.0060.00317.44
8.1.70.0000.00717.48
8.1.60.0060.00317.57
8.1.50.0030.00917.51
8.1.40.0000.00717.47
8.1.30.0070.00417.57
8.1.20.0040.00417.63
8.1.10.0000.00817.59
8.1.00.0060.00317.54
8.0.300.0040.00420.02
8.0.290.0040.00416.63
8.0.280.0000.00718.43
8.0.270.0000.00716.83
8.0.260.0000.00718.53
8.0.250.0040.00416.98
8.0.240.0050.00316.95
8.0.230.0040.00416.84
8.0.220.0030.00316.90
8.0.210.0070.00016.88
8.0.200.0070.00017.02
8.0.190.0000.00716.98
8.0.180.0030.00516.82
8.0.170.0060.00316.93
8.0.160.0050.00217.00
8.0.150.0000.00916.75
8.0.140.0030.00616.82
8.0.130.0030.00313.36
8.0.120.0030.00616.71
8.0.110.0000.00816.98
8.0.100.0030.00516.88
8.0.90.0000.00716.77
8.0.80.0060.01016.86
8.0.70.0000.00816.68
8.0.60.0000.00816.93
8.0.50.0040.00416.69
8.0.30.0110.00817.24
8.0.20.0060.01516.95
8.0.10.0050.00217.05
8.0.00.0080.01116.81
7.4.330.0000.00515.55
7.4.320.0000.00616.59
7.4.300.0000.00616.61
7.4.290.0000.00716.63
7.4.280.0040.00416.59
7.4.270.0000.00716.36
7.4.260.0070.00016.51
7.4.250.0080.00016.49
7.4.240.0000.00816.39
7.4.230.0070.00016.40
7.4.220.0040.00416.61
7.4.210.0070.00816.61
7.4.200.0000.00716.49
7.4.160.0090.00716.57
7.4.140.0090.00917.86
7.4.130.0220.00316.39
7.4.120.0090.01316.63
7.4.110.0100.01016.32
7.4.100.0130.01016.68
7.4.90.0060.01216.59
7.4.80.0090.00919.39
7.4.70.0120.00916.49
7.4.60.0130.00316.53
7.4.50.0030.01016.43
7.4.40.0090.00916.56
7.4.00.0050.01214.90
7.3.330.0020.00213.35
7.3.320.0020.00313.19
7.3.310.0000.00716.39
7.3.300.0000.00716.23
7.3.290.0080.00016.45
7.3.280.0040.01216.36
7.3.260.0110.01116.46
7.3.240.0110.00716.49
7.3.230.0080.00816.62
7.3.210.0110.00616.55
7.3.200.0060.01016.33
7.3.190.0130.00316.30
7.3.180.0090.00916.61
7.3.170.0090.00916.42
7.3.160.0070.00716.66
7.3.120.0090.00914.76
7.3.110.0100.00614.84
7.3.100.0120.00514.94
7.3.90.0070.00714.75
7.3.80.0070.00914.89
7.3.70.0040.00914.85
7.3.60.0080.00514.68
7.3.50.0060.00914.87
7.3.40.0040.01214.65
7.3.30.0080.00514.73
7.3.20.0660.00515.96
7.3.10.0050.00815.88
7.3.00.0720.00515.96
7.2.330.0070.01016.46
7.2.320.0040.01416.66
7.2.310.0110.01116.77
7.2.300.0100.01016.71
7.2.290.0040.01516.55
7.2.250.0050.01215.10
7.2.240.0040.01314.97
7.2.230.0060.00815.03
7.2.220.0080.00515.00
7.2.210.0030.01014.96
7.2.200.0030.01114.86
7.2.190.0040.00814.86
7.2.180.0100.00714.86
7.2.170.0030.01215.05
7.2.160.0080.00315.08
7.2.150.0190.00616.05
7.2.140.0140.00415.85
7.2.130.0100.01115.94
7.2.120.1080.00515.88
7.2.110.0280.01015.85
7.2.100.0940.01016.12
7.2.90.1020.00315.97
7.2.80.0870.00515.81
7.2.70.0960.00715.90
7.2.60.0740.00815.92
7.2.50.0890.00915.87
7.2.40.0530.00915.75
7.2.30.0860.00916.03
7.2.20.0900.00615.78
7.2.10.1170.00715.99
7.2.00.0770.00915.82
7.1.330.0050.01115.82
7.1.320.0070.00515.97
7.1.310.0070.00715.82
7.1.300.0070.00615.72
7.1.290.0030.01015.61
7.1.280.0050.00915.76
7.1.270.0680.00315.18
7.1.260.0600.00915.22
7.1.250.0980.00214.93
7.1.240.0030.01015.81
7.1.230.0000.01315.91
7.1.220.0040.00415.61
7.1.210.0030.00815.79
7.1.200.0030.00915.46
7.1.190.0060.00615.63
7.1.180.0040.00415.70
7.1.170.0070.00315.77
7.1.160.0040.00815.90
7.1.150.0140.00015.76
7.1.140.0030.01015.81
7.1.130.0000.00815.90
7.1.120.0080.00815.79
7.1.110.0100.00315.89
7.1.100.0000.01115.78
7.1.90.0100.00315.80
7.1.80.0080.00615.66
7.1.70.0040.01115.91
7.1.60.0030.01015.93
7.1.50.0030.00615.70
7.1.40.0040.00415.83
7.1.30.0000.01415.51
7.1.20.0050.00515.54
7.1.10.0000.01115.52
7.1.00.0060.00615.76

preferences:
19.81 ms | 403 KiB | 5 Q