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, fn($a, $b) => ($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.0190.00316.63
8.3.60.0100.01016.75
8.3.50.0110.00416.23
8.3.40.0120.00921.89
8.3.30.0150.00318.50
8.3.20.0040.00424.18
8.3.10.0070.00024.66
8.3.00.0040.00426.16
8.2.190.0130.00916.75
8.2.180.0070.01125.92
8.2.170.0070.00718.90
8.2.160.0100.00322.96
8.2.150.0080.00025.66
8.2.140.0000.00924.66
8.2.130.0050.00226.16
8.2.120.0000.00719.66
8.2.110.0100.00521.47
8.2.100.0110.00519.26
8.2.90.0050.01020.13
8.2.80.0100.00819.23
8.2.70.0080.00619.28
8.2.60.0070.00819.33
8.2.50.0070.00619.39
8.2.40.0070.00720.01
8.2.30.0060.00619.94
8.2.20.0050.01019.38
8.2.10.0050.00919.94
8.2.00.0100.00219.97
8.1.280.0120.00925.92
8.1.270.0080.00023.99
8.1.260.0000.00826.35
8.1.250.0000.00828.09
8.1.240.0090.00522.14
8.1.230.0070.00821.47
8.1.220.0100.00419.15
8.1.210.0060.00320.23
8.1.200.0100.00318.84
8.1.190.0040.00918.80
8.1.180.0040.00619.13
8.1.170.0050.00419.32
8.1.160.0050.00319.72
8.1.150.0030.00519.62
8.1.140.0040.00419.59
8.1.130.0070.00420.31
8.1.120.0020.00719.65
8.1.110.0020.00818.84
8.1.100.0060.00418.91
8.1.90.0020.00718.97
8.1.80.0030.00518.85
8.1.70.0030.00520.59
8.1.60.0050.00518.99
8.1.50.0070.00418.95
8.1.40.0030.00619.05
8.1.30.0070.00219.05
8.1.20.0070.00320.73
8.1.10.0050.00519.01
8.1.00.0040.00619.03
8.0.300.0070.00219.63
8.0.290.0030.00518.26
8.0.280.0060.00120.06
8.0.270.0030.00618.38
8.0.260.0060.00218.92
8.0.250.0060.00218.34
8.0.240.0040.00518.37
8.0.230.0060.00220.31
8.0.220.0020.00518.24
8.0.210.0030.00518.39
8.0.200.0070.00218.22
8.0.190.0020.00718.23
8.0.180.0040.00420.22
8.0.170.0050.00418.39
8.0.160.0030.00518.33
8.0.150.0050.00518.35
8.0.140.0030.00518.30
8.0.130.0030.00518.38
8.0.120.0030.00618.25
8.0.110.0010.00718.39
8.0.100.0050.00318.28
8.0.90.0050.00318.13
8.0.80.0050.00819.07
8.0.70.0010.00718.20
8.0.60.0060.00318.26
8.0.50.0020.00618.30
8.0.30.0070.00618.51
8.0.20.0120.00418.03
8.0.10.0010.00718.36
8.0.00.0080.00618.52
7.4.330.0040.00215.13
7.4.320.0060.00217.96
7.4.300.0010.00617.87
7.4.290.0050.00417.94
7.4.280.0070.00218.00
7.4.270.0050.00318.00
7.4.260.0030.00517.80
7.4.250.0050.00417.79
7.4.240.0030.00518.02
7.4.230.0060.00217.86
7.4.220.0050.00217.52
7.4.210.0100.00517.25
7.4.200.0040.00317.97
7.4.190.0080.00019.41
7.4.180.0090.00019.39
7.4.160.0060.00319.28
7.4.150.0040.00419.52
7.4.140.0060.00319.22
7.4.130.0100.01017.53
7.4.120.0110.00617.86
7.4.110.0110.00717.05
7.4.100.0090.00717.00
7.4.90.0090.00716.81
7.4.80.0110.00716.81
7.4.70.0170.00417.06
7.4.60.0120.00916.95
7.4.50.0220.01416.78
7.4.40.0190.00817.01
7.4.30.0280.00516.90
7.4.20.0210.00816.96
7.4.10.0120.00716.93
7.4.00.0120.00617.89
7.3.330.0030.00617.49
7.3.320.0060.00615.08
7.3.310.0090.00416.69
7.3.300.0120.00116.54
7.3.290.0070.00616.49
7.3.280.0180.00317.12
7.3.270.0190.00216.87
7.3.260.0050.01616.75
7.3.250.0140.00417.22
7.3.240.0170.00017.09
7.3.230.0110.00816.69
7.3.220.0100.00916.75
7.3.210.0180.00516.64
7.3.200.0180.01116.61
7.3.190.0180.00616.57
7.3.180.0170.00616.69
7.3.170.0200.00716.77
7.3.160.0190.01016.62
7.3.150.0230.01116.65
7.3.140.0210.01016.54
7.3.130.0170.00916.70
7.3.120.0210.00416.59
7.3.110.0210.00716.74
7.3.100.0150.00816.61
7.3.90.0250.00316.81
7.3.80.0200.00216.65
7.3.70.0150.00316.71
7.3.60.0100.00616.69
7.3.50.0090.00816.71
7.3.40.0160.00216.65
7.3.30.0120.00516.58
7.3.20.0110.00717.76
7.3.10.0170.00917.53
7.3.00.0060.00617.53
7.2.340.0010.01117.63
7.2.330.0100.00716.78
7.2.320.0110.00716.78
7.2.310.0220.00516.47
7.2.300.0180.01116.73
7.2.290.0240.00316.53
7.2.280.0130.00616.78
7.2.270.0100.00816.70
7.2.260.0110.00716.85
7.2.250.0110.00616.68
7.2.240.0160.00116.74
7.2.230.0200.00616.63
7.2.220.0210.00416.85
7.2.210.0210.00816.67
7.2.200.0230.00716.71
7.2.190.0170.01016.70
7.2.180.0150.00816.86
7.2.170.0110.00716.83
7.2.160.0130.00516.89
7.2.150.0140.00417.80
7.2.140.0120.00617.71
7.2.130.0170.01217.77
7.2.120.0200.00517.75
7.2.110.0200.00717.85
7.2.100.0220.00617.67
7.2.90.0210.00617.76
7.2.80.0190.00317.88
7.2.70.0130.01217.70
7.2.60.0090.00917.80
7.2.50.0110.00817.70
7.2.40.0150.00817.85
7.2.30.0220.00617.74
7.2.20.0220.00417.90
7.2.10.0180.00817.80
7.2.00.0090.00517.81

preferences:
58.81 ms | 401 KiB | 5 Q