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, fn($a, $b) => ($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.130.0190.00018.48
8.3.120.0030.00618.70
8.3.110.0000.00820.94
8.3.100.0040.00416.91
8.3.90.0050.00318.52
8.3.80.0100.00019.36
8.3.70.0080.00818.56
8.3.60.0000.01418.18
8.3.50.0040.01423.71
8.3.40.0030.01321.78
8.3.30.0150.00018.67
8.3.20.0080.00324.18
8.3.10.0050.00224.66
8.3.00.0040.00426.16
8.2.250.0000.00818.27
8.2.240.0040.00417.40
8.2.230.0060.00322.58
8.2.220.0050.01024.06
8.2.210.0050.00326.77
8.2.200.0040.00818.54
8.2.190.0150.00618.67
8.2.180.0070.00725.92
8.2.170.0140.00719.00
8.2.160.0110.00422.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00721.08
8.2.110.0060.00320.53
8.2.100.0110.00017.78
8.2.90.0050.00318.03
8.2.80.0000.00919.27
8.2.70.0040.00417.93
8.2.60.0040.00418.34
8.2.50.0040.00418.07
8.2.40.0040.00418.29
8.2.30.0040.00418.14
8.2.20.0040.00418.16
8.2.10.0040.00419.43
8.2.00.0040.00419.32
8.1.300.0030.00619.43
8.1.290.0060.00318.88
8.1.280.0090.00625.92
8.1.270.0040.00423.79
8.1.260.0000.00726.35
8.1.250.0070.00028.09
8.1.240.0060.00322.08
8.1.230.0110.00022.18
8.1.220.0000.00917.74
8.1.210.0040.00418.97
8.1.200.0090.00017.47
8.1.190.0040.00417.23
8.1.180.0080.00018.10
8.1.170.0000.00818.86
8.1.160.0080.00018.79
8.1.150.0040.00418.91
8.1.140.0000.00718.98
8.1.130.0070.00020.17
8.1.120.0070.00017.45
8.1.110.0000.00717.52
8.1.100.0000.00817.46
8.1.90.0050.00317.30
8.1.80.0000.00817.46
8.1.70.0000.00717.46
8.1.60.0060.00317.57
8.1.50.0030.00617.59
8.1.40.0040.00417.54
8.1.30.0050.00217.73
8.1.20.0000.00717.56
8.1.10.0000.00817.49
8.1.00.0000.01117.37
8.0.300.0070.00020.21
8.0.290.0000.00716.75
8.0.280.0070.00018.46
8.0.270.0000.00716.82
8.0.260.0030.00320.15
8.0.250.0040.00417.06
8.0.240.0040.00416.98
8.0.230.0040.00416.86
8.0.220.0070.00016.90
8.0.210.0040.00416.93
8.0.200.0000.00716.91
8.0.190.0070.00016.93
8.0.180.0000.00816.90
8.0.170.0040.00416.82
8.0.160.0050.00316.87
8.0.150.0030.00316.82
8.0.140.0070.00016.86
8.0.130.0000.00613.41
8.0.120.0050.00316.76
8.0.110.0000.00816.83
8.0.100.0040.00416.86
8.0.90.0000.00716.90
8.0.80.0060.00716.87
8.0.70.0040.00416.92
8.0.60.0000.00816.95
8.0.50.0070.00016.75
8.0.30.0080.01416.81
8.0.20.0140.00517.12
8.0.10.0090.00917.10
8.0.00.0070.01316.94
7.4.330.0120.00622.46
7.4.320.0030.00316.50
7.4.300.0050.00216.45
7.4.290.0050.00316.41
7.4.280.0000.00716.43
7.4.270.0040.00416.65
7.4.260.0030.00413.28
7.4.250.0030.00316.39
7.4.240.0040.00316.59
7.4.230.0030.00416.48
7.4.220.0030.00316.48
7.4.210.0090.00616.47
7.4.200.0040.00416.39
7.4.140.0000.01816.33
7.4.130.0090.01116.47
7.4.120.0120.00716.40
7.4.110.0060.01016.30
7.4.100.0120.00516.30
7.4.90.0100.00816.48
7.4.80.0110.00816.54
7.4.70.0060.01016.39
7.4.60.0120.00716.31
7.4.50.0090.00916.53
7.4.40.0100.00716.41
7.4.30.0090.01016.57
7.4.20.0080.00916.32
7.4.10.0060.01216.57
7.4.00.0080.00916.68
7.3.330.0030.00316.23
7.3.320.0060.00013.22
7.3.310.0040.00416.13
7.3.300.0000.00616.16
7.3.290.0060.01016.18
7.3.260.0040.01616.12
7.3.250.0160.00016.21
7.3.240.0140.00716.37
7.3.230.0080.00816.06
7.3.220.0090.00916.23
7.3.210.0070.01016.11
7.3.200.0090.00816.15
7.3.190.0090.00716.23
7.3.180.0110.00616.15
7.3.170.0150.00716.28
7.3.160.0070.01016.22
7.3.150.0120.00616.33
7.3.140.0090.00816.30
7.3.130.0050.01116.23
7.3.120.0130.00816.26
7.3.110.0110.00916.34
7.3.100.0090.00816.32
7.3.90.0090.00716.15
7.3.80.0100.00616.33
7.3.70.0070.01016.14
7.3.60.0120.00916.23
7.3.50.0110.00716.26
7.3.40.0090.01016.20
7.3.30.0100.00816.22
7.3.20.0230.00816.19
7.3.10.0120.00516.16
7.3.00.0090.00916.10
7.2.340.0100.01116.30
7.2.330.0070.00916.32
7.2.320.0070.01216.09
7.2.310.0090.00716.22
7.2.300.0150.00416.36
7.2.290.0110.00616.14
7.2.280.0080.00816.30
7.2.270.0150.00316.43
7.2.260.0120.00616.51
7.2.250.0070.01616.47
7.2.240.0160.00216.17
7.2.230.0120.00516.38
7.2.220.0080.00916.33
7.2.210.0110.00516.37
7.2.200.0090.00916.29
7.2.190.0070.01716.22
7.2.180.0090.01116.37
7.2.170.0110.00816.38
7.2.160.0060.01116.28
7.2.150.0130.00516.39
7.2.140.0130.00616.42
7.2.130.0090.00916.22
7.2.120.0420.00816.29
7.2.110.0090.00916.20
7.2.100.0130.00916.30
7.2.90.0130.00916.26
7.2.80.0090.00916.17
7.2.70.0070.01416.23
7.2.60.0140.00316.26
7.2.50.0090.00916.32
7.2.40.0100.00816.29
7.2.30.0090.00916.28
7.2.20.0090.00916.32
7.2.10.0100.00716.21
7.2.00.0140.00516.26

preferences:
29.44 ms | 403 KiB | 5 Q