3v4l.org

run code in 300+ PHP versions simultaneously
<?php $subjectSlots = [ "tamil" => [1, 2, 3, 4, 5], "english" => [4, 5, 6], "maths" => [1, 5, 8], "social" => [1, 2, 5], "pt" => [1], "hindi" => [3, 4, 7] ]; $requiredSubjects = ['tamil', 'tamil', 'pt', 'maths', 'maths', 'social', 'hindi', 'english']; usort($requiredSubjects, function($a, $b) use ($subjectSlots) { return $subjectSlots[$a] <=> $subjectSlots[$b]; }); var_export($requiredSubjects);

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.20.0110.00619.59
8.5.10.0110.00816.55
8.5.00.0120.01019.92
8.4.170.0110.01123.92
8.4.160.0110.01023.93
8.4.150.0020.00014.05
8.4.140.0140.00717.41
8.4.130.0140.00717.70
8.4.120.0130.00720.54
8.4.110.0130.01018.88
8.4.100.0120.00818.88
8.4.90.0130.00720.45
8.4.80.0130.00817.75
8.4.70.0040.00518.07
8.4.60.0100.01118.79
8.4.50.0100.00918.66
8.4.40.0160.00318.79
8.4.30.0070.01318.55
8.4.20.0180.00319.60
8.4.10.0050.00320.43
8.3.300.0130.00820.67
8.3.290.0110.01018.45
8.3.280.0200.00718.16
8.3.270.0100.01116.54
8.3.260.0110.00816.74
8.3.250.0080.01119.03
8.3.240.0100.00816.57
8.3.230.0100.01016.47
8.3.220.0110.00919.11
8.3.210.0090.00816.81
8.3.200.0060.00516.53
8.3.190.0090.00917.04
8.3.180.0130.00516.84
8.3.170.0150.00320.79
8.3.160.0110.00717.11
8.3.150.0090.00918.71
8.3.140.0140.00416.62
8.3.130.0080.00018.52
8.3.120.0090.00020.83
8.3.110.0100.01018.60
8.3.100.0040.00416.49
8.3.90.0070.01026.77
8.3.80.0050.00519.36
8.3.70.0210.00016.63
8.3.60.0110.00316.63
8.3.50.0110.00923.68
8.3.40.0040.01120.73
8.3.30.0110.00418.66
8.3.20.0080.00024.18
8.3.10.0050.00324.66
8.3.00.0040.00426.16
8.2.300.0140.00618.87
8.2.290.0140.00420.55
8.2.280.0020.00618.56
8.2.270.0110.00719.10
8.2.260.0040.01118.29
8.2.250.0060.00917.13
8.2.240.0080.00017.20
8.2.230.0150.00020.94
8.2.220.0000.00824.06
8.2.210.0040.00426.77
8.2.200.0060.00318.88
8.2.190.0070.00718.17
8.2.180.0110.00725.92
8.2.170.0150.00322.96
8.2.160.0140.00022.96
8.2.150.0080.00025.66
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0050.00326.35
8.2.110.0100.00022.17
8.2.100.0040.00717.78
8.2.90.0040.00417.91
8.2.80.0060.00319.23
8.2.70.0080.00017.63
8.2.60.0080.00018.16
8.2.50.0040.00418.05
8.2.40.0080.00018.34
8.2.30.0050.00318.17
8.2.20.0080.00018.18
8.2.10.0040.00419.33
8.2.00.0030.00619.28
8.1.340.0100.01117.63
8.1.330.0120.00721.82
8.1.320.0140.00816.22
8.1.310.0140.00418.53
8.1.300.0060.00315.98
8.1.290.0060.00330.84
8.1.280.0070.01425.92
8.1.270.0030.00523.99
8.1.260.0040.00428.09
8.1.250.0000.00828.09
8.1.240.0090.00022.66
8.1.230.0120.00020.82
8.1.220.0030.00717.74
8.1.210.0000.00918.77
8.1.200.0030.00617.48
8.1.190.0060.00617.35
8.1.180.0030.00518.10
8.1.170.0040.00417.62
8.1.160.0050.00320.73
8.1.150.0060.00318.95
8.1.140.0050.00318.81
8.1.130.0000.00720.05
8.1.120.0000.00717.50
8.1.110.0000.00817.49
8.1.100.0000.00817.34
8.1.90.0050.00217.39
8.1.80.0000.00717.35
8.1.70.0030.00617.50
8.1.60.0050.00317.54
8.1.50.0080.00417.52
8.1.40.0000.00817.44
8.1.30.0030.00517.58
8.1.20.0030.00517.70
8.1.10.0040.00417.60
8.1.00.0030.00517.57
8.0.300.0070.00020.09
8.0.290.0070.00016.75
8.0.280.0070.00018.43
8.0.270.0000.00818.06
8.0.260.0070.00020.15
8.0.250.0000.00617.05
8.0.240.0040.00416.88
8.0.230.0000.00717.01
8.0.220.0030.00316.95
8.0.210.0080.00017.01
8.0.200.0030.00316.85
8.0.190.0050.00316.91
8.0.180.0080.00016.87
8.0.170.0060.00316.92
8.0.160.0070.00016.77
8.0.150.0040.00416.79
8.0.140.0040.00416.84
8.0.130.0050.00013.27
8.0.120.0040.00416.85
8.0.110.0000.00716.95
8.0.100.0040.00416.75
8.0.90.0060.00316.69
8.0.80.0090.00716.83
8.0.70.0080.00016.77
8.0.60.0040.00416.76
8.0.50.0000.00816.77
8.0.30.0100.00717.07
8.0.20.0080.01117.11
8.0.10.0000.00817.12
8.0.00.0120.00816.69
7.4.330.0000.00715.55
7.4.320.0060.00016.56
7.4.300.0060.00316.61
7.4.290.0040.00416.34
7.4.280.0040.00416.58
7.4.270.0110.00016.61
7.4.260.0060.00013.27
7.4.250.0000.00716.57
7.4.240.0050.00216.49
7.4.230.0060.00016.38
7.4.220.0020.00516.57
7.4.210.0090.00916.58
7.4.200.0030.00416.68
7.4.130.0080.00816.53
7.4.120.0100.01016.51
7.4.110.0130.01016.46
7.4.100.0100.00616.33
7.4.90.0100.00716.45
7.4.80.0070.01119.39
7.4.70.0200.00316.52
7.4.60.0080.00816.53
7.4.50.0100.00716.37
7.4.40.0110.00616.41
7.4.30.0090.00916.31
7.4.20.0080.01216.18
7.4.10.0090.00916.32
7.4.00.0060.01316.41
7.3.330.0060.00016.18
7.3.320.0000.00613.25
7.3.310.0070.00016.35
7.3.300.0040.00416.24
7.3.290.0050.01016.30
7.3.280.0070.00716.30
7.3.260.0100.01016.30
7.3.240.0100.00716.43
7.3.230.0030.01316.39
7.3.210.0090.01016.46
7.3.200.0090.01316.46
7.3.190.0030.01316.35
7.3.180.0060.00916.52
7.3.170.0090.00816.31
7.3.160.0080.00816.25
7.3.150.0050.01216.09
7.3.140.0100.00616.23
7.3.130.0110.00916.44
7.3.120.0080.00816.46
7.3.110.0080.00916.27
7.3.100.0080.00916.30
7.3.90.0040.01416.21
7.3.80.0110.00616.31
7.3.70.0130.00816.31
7.3.60.0110.00816.30
7.3.50.0110.00616.31
7.3.40.0110.00616.27
7.3.30.0090.00716.37
7.3.20.0060.01216.27
7.3.10.0080.00816.34
7.3.00.0110.00616.43
7.2.330.0100.01016.70
7.2.320.0040.01916.43
7.2.310.0080.00816.61
7.2.300.0060.01116.69
7.2.290.0070.01016.37
7.2.280.0100.00716.55
7.2.270.0030.01516.36
7.2.260.0080.00916.37
7.2.250.0090.01216.56
7.2.240.0120.00416.57
7.2.230.0080.01016.48
7.2.220.0090.01016.48
7.2.210.0070.00916.53
7.2.200.0090.00716.37
7.2.190.0060.01216.50
7.2.180.0070.01016.51
7.2.170.0050.01216.37
7.2.160.0090.00716.43
7.2.150.0310.00616.52
7.2.140.0090.00816.54
7.2.130.0100.00916.50
7.2.120.0140.00816.45
7.2.110.0100.01016.59
7.2.100.0130.00816.48
7.2.90.0050.01416.50
7.2.80.0120.01416.63
7.2.70.0100.00716.49
7.2.60.0100.00916.44
7.2.50.0070.01416.55
7.2.40.0100.01016.54
7.2.30.0080.01316.51
7.2.20.0110.00816.56
7.2.10.0110.00916.44
7.2.00.0120.00816.76

preferences:
31.83 ms | 403 KiB | 5 Q