3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = [ [ 'id' => 2, 'position' => 2, ], [ 'id' => 1, 'position' => 1, ], [ 'id' => 1, 'position' => 0, ], [ 'id' => 2, 'position' => 1, ], [ 'id' => 2, 'position' => 0, ], [ 'id' => 1, 'position' => 2, ], ]; usort( $data, function ($a, $b) { if ($a['position'] == $b['position']) { return 0; } return ($a['position'] < $b['position']) ? 1 : -1; } ); usort( $data, function ($a, $b) { if ($a['id'] == $b['id']) { return 0; } return ($a['id'] < $b['id']) ? -1 : 1; } ); var_dump($data);

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.0150.00316.63
8.3.50.0090.00616.47
8.3.40.0120.00318.79
8.3.30.0090.00618.64
8.3.20.0040.00420.22
8.3.10.0030.00521.89
8.3.00.0040.00423.67
8.2.180.0150.00716.63
8.2.170.0030.01722.96
8.2.160.0110.00320.34
8.2.150.0090.00024.18
8.2.140.0000.00924.66
8.2.130.0050.00319.77
8.2.120.0000.00726.35
8.2.110.0060.00322.24
8.2.100.0090.00318.16
8.2.90.0080.00019.30
8.2.80.0000.00817.97
8.2.70.0030.00617.49
8.2.60.0030.00618.04
8.2.50.0040.00418.07
8.2.40.0000.00822.14
8.2.30.0000.00819.54
8.2.20.0000.00817.80
8.2.10.0000.00718.19
8.2.00.0080.00018.06
8.1.280.0040.01125.92
8.1.270.0050.00323.96
8.1.260.0080.00328.09
8.1.250.0040.00428.09
8.1.240.0140.00723.92
8.1.230.0000.01219.01
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0000.00817.23
8.1.180.0000.00918.10
8.1.170.0040.00418.62
8.1.160.0000.00720.82
8.1.150.0000.00818.82
8.1.140.0000.00819.50
8.1.130.0000.00717.77
8.1.120.0040.00417.48
8.1.110.0000.00817.52
8.1.100.0020.00517.50
8.1.90.0040.00417.49
8.1.80.0000.00817.36
8.1.70.0030.00317.37
8.1.60.0060.00317.61
8.1.50.0000.00817.49
8.1.40.0000.00817.54
8.1.30.0000.00917.66
8.1.20.0000.00817.66
8.1.10.0000.00717.49
8.1.00.0030.00517.40
8.0.300.0070.00018.77
8.0.290.0040.00416.75
8.0.280.0000.00718.30
8.0.270.0050.00217.16
8.0.260.0000.00617.10
8.0.250.0000.00616.98
8.0.240.0070.00016.85
8.0.230.0030.00316.85
8.0.220.0030.00316.86
8.0.210.0000.00716.76
8.0.200.0070.00016.83
8.0.190.0040.00416.84
8.0.180.0040.00416.80
8.0.170.0120.00016.98
8.0.160.0040.00416.90
8.0.150.0040.00416.89
8.0.140.0000.00716.75
8.0.130.0000.00513.27
8.0.120.0000.00816.77
8.0.110.0000.00816.92
8.0.100.0040.00416.77
8.0.90.0070.00016.78
8.0.80.0130.00316.95
8.0.70.0050.00216.72
8.0.60.0040.00416.77
8.0.50.0040.00416.86
8.0.30.0060.01616.96
8.0.20.0100.01217.40
8.0.10.0040.00416.91
8.0.00.0110.01016.72
7.4.330.0050.00016.79
7.4.320.0000.00616.43
7.4.300.0030.00516.63
7.4.290.0070.00016.49
7.4.280.0030.00616.64
7.4.270.0000.00716.52
7.4.260.0050.00316.47
7.4.250.0000.00716.48
7.4.240.0070.00016.57
7.4.230.0000.00716.71
7.4.220.0040.01416.65
7.4.210.0060.00916.68
7.4.200.0070.00016.63
7.4.160.0130.00316.38
7.4.150.0120.00617.40
7.4.140.0110.01117.86
7.4.130.0110.00816.53
7.4.120.0140.00716.53
7.4.110.0180.00616.36
7.4.100.0120.00916.46
7.4.90.0100.00716.42
7.4.80.0140.00319.39
7.4.70.0120.01216.64
7.4.60.0100.00716.43
7.4.50.0030.01316.07
7.4.40.0140.00416.47
7.4.30.0060.01216.44
7.4.00.0120.00315.14
7.3.330.0050.00013.27
7.3.320.0070.00013.13
7.3.310.0030.00316.30
7.3.300.0030.00516.29
7.3.290.0090.00616.20
7.3.280.0070.00916.21
7.3.270.0180.00917.40
7.3.260.0100.00716.24
7.3.250.0090.00816.40
7.3.240.0120.01016.45
7.3.230.0070.01016.57
7.3.210.0100.00716.30
7.3.200.0100.01219.39
7.3.190.0130.01516.21
7.3.180.0090.00616.28
7.3.170.0080.01216.34
7.3.160.0090.00916.51
7.2.330.0150.00316.34
7.2.320.0110.00716.48
7.2.310.0000.01616.43
7.2.300.0110.00616.48
7.2.290.0060.01216.51
7.2.60.0090.00616.72
7.2.00.0040.01119.24
7.1.200.0070.00715.72
7.1.100.0040.01117.97
7.1.70.0070.00017.02
7.1.60.0070.01719.27
7.1.50.0140.00716.63
7.1.00.0000.08022.46
7.0.200.0000.01116.82
7.0.60.0100.08021.72
7.0.50.0070.03717.97
7.0.40.0070.08720.11
7.0.30.0200.03720.21
7.0.20.0170.04320.24
7.0.10.0030.04720.33
7.0.00.0100.09020.23
5.6.280.0030.03321.03
5.6.210.0100.07320.76
5.6.200.0130.07318.22
5.6.190.0030.07020.61
5.6.180.0270.07720.35
5.6.170.0200.04320.57
5.6.160.0030.04320.52
5.6.150.0100.06718.24
5.6.140.0030.08718.21
5.6.130.0030.08318.14
5.6.120.0030.04021.15
5.6.110.0100.08020.90
5.6.100.0000.04720.98
5.6.90.0130.08321.04
5.6.80.0100.08320.38
5.5.350.0030.08320.44
5.5.340.0030.08018.04
5.5.330.0070.04720.29
5.5.320.0630.07020.42
5.5.310.0230.08020.28
5.5.300.0130.07317.98
5.5.290.0070.05318.10
5.5.280.0070.06020.88
5.5.270.0030.04020.89
5.5.260.0170.07720.65
5.5.250.0130.08020.70
5.5.240.0170.07320.26

preferences:
56.36 ms | 400 KiB | 5 Q