3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['id' => '111', 'value' => 'abc'], ['id' => '100', 'value' => 'abc'], ['id' => '132', 'value' => 'abc'], ['id' => '222', 'value' => 'abc'], ['id' => '112', 'value' => 'abc'], ['id' => '200', 'value' => 'abc'] ]; $idPriorities = array_flip(['112', '111', '132', '100']); $idOutlier = count($idPriorities); usort( $array, function($a, $b) use ($idPriorities, $idOutlier) { return ($idPriorities[$a['id']] ?? $idOutlier) <=> ($idPriorities[$b['id']] ?? $idOutlier); } ); var_export($array);

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.3.70.0100.01016.58
8.3.60.0120.00916.38
8.3.50.0160.00316.33
8.3.40.0070.01321.90
8.3.30.0130.00318.64
8.3.20.0070.00024.18
8.3.10.0060.00324.66
8.3.00.0000.00826.16
8.2.190.0100.01016.88
8.2.180.0140.00025.92
8.2.170.0110.00318.99
8.2.160.0110.00722.96
8.2.150.0030.00525.66
8.2.140.0030.00624.66
8.2.130.0070.00026.16
8.2.120.0040.00419.66
8.2.110.0030.00620.70
8.2.100.0090.00317.84
8.2.90.0050.00320.64
8.2.80.0080.00018.77
8.2.70.0040.00417.75
8.2.60.0050.00318.05
8.2.50.0080.00018.05
8.2.40.0080.00318.22
8.2.30.0080.00018.10
8.2.20.0080.00018.01
8.2.10.0020.00519.26
8.2.00.0000.00719.23
8.1.280.0110.01125.92
8.1.270.0000.00823.99
8.1.260.0040.00426.35
8.1.250.0060.00328.09
8.1.240.0060.00622.16
8.1.230.0090.00322.70
8.1.220.0040.00417.79
8.1.210.0000.00918.77
8.1.200.0100.00017.35
8.1.190.0040.00417.35
8.1.180.0030.00618.10
8.1.170.0030.00518.47
8.1.160.0040.00419.02
8.1.150.0050.00318.93
8.1.140.0040.00418.86
8.1.130.0000.00717.45
8.1.120.0080.00017.49
8.1.110.0050.00517.41
8.1.100.0000.00717.47
8.1.90.0030.00617.48
8.1.80.0040.00417.46
8.1.70.0040.00417.52
8.1.60.0090.00017.63
8.1.50.0040.00417.49
8.1.40.0020.00517.45
8.1.30.0110.00017.57
8.1.20.0080.00017.63
8.1.10.0040.00417.48
8.1.00.0030.00517.55
8.0.300.0000.00718.77
8.0.290.0060.00316.75
8.0.280.0030.00318.43
8.0.270.0040.00418.07
8.0.260.0060.00016.89
8.0.250.0030.00317.06
8.0.240.0060.00316.91
8.0.230.0040.00417.02
8.0.220.0040.00416.94
8.0.210.0040.00416.95
8.0.200.0000.00716.95
8.0.190.0070.00016.95
8.0.180.0040.00416.80
8.0.170.0030.00516.93
8.0.160.0000.00716.89
8.0.150.0040.00416.84
8.0.140.0050.00216.86
8.0.130.0050.00013.34
8.0.120.0000.00916.81
8.0.110.0000.00816.92
8.0.100.0040.00416.76
8.0.90.0000.00716.87
8.0.80.0040.01116.85
8.0.70.0040.00416.88
8.0.60.0040.00416.95
8.0.50.0040.00416.76
8.0.30.0120.00917.26
8.0.20.0140.00617.12
8.0.10.0030.00316.90
8.0.00.0110.00716.75
7.4.330.0030.00315.55
7.4.320.0030.00316.50
7.4.300.0000.00716.64
7.4.290.0030.00616.47
7.4.280.0000.00916.57
7.4.270.0070.00016.49
7.4.260.0000.00913.31
7.4.250.0080.00016.51
7.4.240.0000.00716.63
7.4.230.0070.00016.41
7.4.220.0020.00516.50
7.4.210.0080.00616.57
7.4.200.0000.00716.34
7.4.130.0120.00716.48
7.4.120.0150.01016.42
7.4.110.0060.00916.51
7.4.100.0080.00816.57
7.4.90.0090.00916.36
7.4.80.0080.00816.39
7.4.70.0060.01616.52
7.4.60.0090.01316.41
7.4.50.0060.01216.29
7.4.40.0100.01316.73
7.4.30.0160.01116.54
7.4.20.0070.01016.57
7.4.10.0090.00916.57
7.4.00.0120.00916.06
7.3.330.0000.00716.33
7.3.320.0060.00013.37
7.3.310.0030.00516.35
7.3.300.0000.00716.22
7.3.290.0090.00716.38
7.3.280.0100.00616.33
7.3.260.0090.01216.34
7.3.230.0130.00316.53
7.3.220.0100.00616.42
7.3.210.0130.00316.43
7.3.200.0080.00816.48
7.3.190.0080.00816.46
7.3.180.0140.00816.38
7.3.170.0060.01116.39
7.3.160.0060.01216.54
7.3.150.0180.00616.48
7.3.140.0110.00616.37
7.3.130.0100.00716.33
7.3.120.0110.00616.37
7.3.110.0110.00516.29
7.3.100.0060.01316.25
7.3.90.0100.01316.55
7.3.80.0130.00916.25
7.3.70.0130.00616.42
7.3.60.0040.01516.33
7.3.50.0090.00916.36
7.3.40.0150.00616.33
7.3.30.0160.00616.38
7.3.20.0150.00316.55
7.3.10.0090.00916.45
7.3.00.0100.00716.43
7.2.340.0100.01016.36
7.2.330.0100.00716.70
7.2.320.0110.00616.52
7.2.310.0120.01216.48
7.2.300.0140.00316.40
7.2.290.0140.00316.73
7.2.280.0120.00916.53
7.2.270.0080.01216.64
7.2.260.0080.00816.24
7.2.250.0120.01216.71
7.2.240.0110.00616.54
7.2.230.0070.01116.26
7.2.220.0070.01516.43
7.2.210.0120.01016.52
7.2.200.0110.00516.64
7.2.190.0080.01216.63
7.2.180.0110.01116.40
7.2.170.0090.00916.41
7.2.160.0110.00816.71
7.2.150.0160.00316.50
7.2.140.0110.01016.52
7.2.130.0100.01616.55
7.2.120.0070.01716.55
7.2.110.0120.01216.48
7.2.100.0140.01116.54
7.2.90.0200.00716.42
7.2.80.0200.00616.57
7.2.70.0060.01916.64
7.2.60.0170.01416.44
7.2.50.0030.01516.52
7.2.40.0100.01616.66
7.2.30.0220.00416.63
7.2.20.0180.00816.65
7.2.10.0140.01016.54
7.2.00.0100.01016.40

preferences:
67.13 ms | 401 KiB | 5 Q