3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['id' => 7867867, 'title' => 'Some Title'], ['id' => 3452342, 'title' => 'Some Title'], ['id' => 'foo', 'title' => 'Some Title'], ['id' => 1231233, 'title' => 'Some Title'], ['id' => 'bar', 'title' => 'Some Title'], ['id' => 5867867, 'title' => 'Some Title'] ]; // restructure with values as keys, and keys as order (ASC) $order = array_flip([3452342, 5867867, 7867867, 1231233]); // generating $order = [3452342 => 0, 5867867 => 1, 7867867 => 2, 1231233 => 3]; $default = count($order); // generating $default = 4 usort($array, function($a, $b) use($order, $default) { return ($order[$a['id']] ?? $default) <=> ($order[$b['id']] ?? $default); }); 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.60.0070.00718.16
8.3.50.0170.00016.31
8.3.40.0070.00722.05
8.3.30.0140.00418.38
8.3.20.0060.00624.18
8.3.10.0040.00424.66
8.3.00.0080.00026.16
8.2.180.0100.00716.50
8.2.170.0110.00719.08
8.2.160.0150.00022.96
8.2.150.0000.00825.66
8.2.140.0040.00724.66
8.2.130.0040.00426.16
8.2.120.0000.00821.18
8.2.110.0030.00619.27
8.2.100.0040.00817.78
8.2.90.0050.00317.88
8.2.80.0000.00818.78
8.2.70.0040.00417.63
8.2.60.0040.00417.50
8.2.50.0040.00417.75
8.2.40.0060.00319.65
8.2.30.0040.00419.20
8.2.20.0040.00418.20
8.2.10.0040.00419.43
8.2.00.0050.00219.27
8.1.280.0110.00825.92
8.1.270.0040.00422.13
8.1.260.0040.00426.35
8.1.250.0030.00528.09
8.1.240.0100.00019.14
8.1.230.0080.00417.66
8.1.220.0000.00917.74
8.1.210.0060.00318.77
8.1.200.0040.00417.23
8.1.190.0040.00417.35
8.1.180.0050.00318.10
8.1.170.0040.00417.62
8.1.160.0050.00219.07
8.1.150.0000.00718.89
8.1.140.0040.00418.91
8.1.130.0000.00717.45
8.1.120.0030.00317.49
8.1.110.0050.00317.44
8.1.100.0050.00217.36
8.1.90.0030.00617.50
8.1.80.0040.00417.50
8.1.70.0070.00017.36
8.1.60.0040.00417.50
8.1.50.0080.00017.57
8.1.40.0030.00717.43
8.1.30.0070.00017.68
8.1.20.0080.00017.70
8.1.10.0040.00417.55
8.1.00.0050.00317.38
8.0.300.0040.00418.77
8.0.290.0040.00416.63
8.0.280.0070.00018.29
8.0.270.0030.00516.94
8.0.260.0080.00016.76
8.0.250.0030.00317.05
8.0.240.0040.00417.09
8.0.230.0070.00017.09
8.0.220.0040.00416.99
8.0.210.0030.00316.89
8.0.200.0030.00316.97
8.0.190.0030.00516.94
8.0.180.0000.00716.92
8.0.170.0060.00316.95
8.0.160.0050.00216.87
8.0.150.0000.00716.89
8.0.140.0050.00316.89
8.0.130.0050.00013.33
8.0.120.0000.00816.87
8.0.110.0040.00416.78
8.0.100.0040.00416.89
8.0.90.0070.00016.71
8.0.80.0060.01016.88
8.0.70.0070.00016.88
8.0.60.0050.00316.91
8.0.50.0000.00716.75
8.0.30.0100.01016.99
8.0.20.0110.00916.97
8.0.10.0210.00016.89
8.0.00.0040.01117.36
7.4.330.0100.00314.99
7.4.320.0030.00316.51
7.4.300.0000.00716.61
7.4.290.0050.00316.38
7.4.280.0050.00216.50
7.4.270.0000.00716.50
7.4.260.0050.00013.30
7.4.250.0000.00716.53
7.4.240.0040.00416.62
7.4.230.0000.00716.62
7.4.220.0050.00216.49
7.4.210.0070.00916.63
7.4.200.0030.00316.59
7.4.160.0100.00716.63
7.4.150.0180.00616.47
7.4.140.0120.00916.38
7.4.130.0110.00616.39
7.4.120.0090.01016.56
7.4.110.0140.00616.52
7.4.100.0100.00916.46
7.4.90.0120.00816.52
7.4.80.0080.00816.35
7.4.70.0070.00916.39
7.4.60.0050.01516.48
7.4.50.0080.01016.30
7.4.40.0140.00816.32
7.4.30.0170.00116.34
7.4.20.0070.00916.53
7.4.10.0090.00816.52
7.4.00.0090.00816.59
7.3.330.0070.00016.35
7.3.320.0050.00013.10
7.3.310.0030.00416.38
7.3.300.0000.00716.24
7.3.290.0100.00616.33
7.3.270.0080.00816.32
7.3.260.0090.01016.36
7.3.250.0120.00916.30
7.3.240.0070.00716.32
7.3.230.0080.01116.29
7.3.220.0150.00216.29
7.3.210.0120.00616.24
7.3.200.0130.00516.31
7.3.190.0110.00616.22
7.3.180.0100.00816.32
7.3.170.0070.01216.37
7.3.160.0110.00816.23
7.3.150.0110.00516.44
7.3.140.0090.00916.41
7.3.130.0120.00716.33
7.3.120.0030.01216.25
7.3.110.0080.01016.23
7.3.100.0030.01316.34
7.3.90.0100.00616.40
7.3.80.0140.00516.36
7.3.70.0080.00816.48
7.3.60.0060.01016.38
7.3.50.0090.01016.48
7.3.40.0060.00916.35
7.3.30.0070.00916.31
7.3.20.0140.00816.43
7.3.10.0070.00916.26
7.3.00.0160.00816.42
7.2.340.0160.00716.37
7.2.330.0190.00516.40
7.2.320.0150.00916.43
7.2.310.0180.00716.48
7.2.300.0190.00816.46
7.2.290.0180.00916.46
7.2.280.0100.01316.40
7.2.270.0180.00816.44
7.2.260.0150.01116.52
7.2.250.0160.01016.47
7.2.240.0180.00716.36
7.2.230.0160.00716.41
7.2.220.0130.01016.43
7.2.210.0150.00816.33
7.2.200.0090.01516.51
7.2.190.0110.01216.45
7.2.180.0160.00816.56
7.2.170.0130.01016.49
7.2.160.0180.00716.50
7.2.150.0120.01116.51
7.2.140.0160.00916.52
7.2.130.0150.01116.55
7.2.120.0110.01216.59
7.2.110.0210.00616.65
7.2.100.0130.01416.62
7.2.90.0160.01016.55
7.2.80.0160.01116.58
7.2.70.0180.00616.63
7.2.60.0130.01116.65
7.2.50.0150.00916.55
7.2.40.0150.01016.56
7.2.30.0160.00816.54
7.2.20.0300.01416.62
7.2.10.0130.01216.58
7.2.00.0150.01016.54

preferences:
56.14 ms | 400 KiB | 5 Q