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.0070.00716.61
8.3.50.0110.00821.25
8.3.40.0120.00318.70
8.3.30.0110.00418.57
8.3.20.0080.00020.29
8.3.10.0080.00021.85
8.3.00.0040.00423.58
8.2.180.0080.00816.88
8.2.170.0110.00622.96
8.2.160.0150.00020.38
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0030.00619.76
8.2.120.0000.00826.35
8.2.110.0060.00322.23
8.2.100.0070.00418.18
8.2.90.0050.00319.34
8.2.80.0060.00318.03
8.2.70.0030.00617.63
8.2.60.0000.00817.80
8.2.50.0040.00418.07
8.2.40.0030.00622.37
8.2.30.0000.00719.62
8.2.20.0000.00817.66
8.2.10.0000.00718.23
8.2.00.0000.00718.04
8.1.280.0040.01125.92
8.1.270.0000.00723.84
8.1.260.0070.00328.09
8.1.250.0070.00028.09
8.1.240.0070.01023.84
8.1.230.0080.00319.10
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0000.00917.36
8.1.190.0030.00517.23
8.1.180.0050.00318.10
8.1.170.0030.00518.70
8.1.160.0000.00820.78
8.1.150.0050.00218.86
8.1.140.0000.00819.58
8.1.130.0060.00317.71
8.1.120.0030.00617.54
8.1.110.0070.00017.50
8.1.100.0080.00017.44
8.1.90.0070.00017.36
8.1.80.0000.00817.45
8.1.70.0030.00317.38
8.1.60.0030.00517.66
8.1.50.0060.00317.43
8.1.40.0040.00417.48
8.1.30.0030.00517.67
8.1.20.0030.00617.50
8.1.10.0080.00017.57
8.1.00.0080.00017.51
8.0.300.0050.00218.77
8.0.290.0030.00616.75
8.0.280.0000.00718.37
8.0.270.0050.00317.11
8.0.260.0030.00317.06
8.0.250.0000.00716.84
8.0.240.0040.00417.04
8.0.230.0030.00516.86
8.0.220.0030.00316.85
8.0.210.0030.00316.86
8.0.200.0030.00316.98
8.0.190.0040.00416.92
8.0.180.0040.00416.89
8.0.170.0060.00316.89
8.0.160.0030.00316.89
8.0.150.0000.00716.76
8.0.140.0000.00816.75
8.0.130.0000.00613.28
8.0.120.0030.00616.79
8.0.110.0000.00716.91
8.0.100.0000.00816.67
8.0.90.0050.00316.71
8.0.80.0040.01116.89
8.0.70.0000.00816.96
8.0.60.0000.00816.94
8.0.50.0040.00416.75
8.0.30.0120.00716.97
8.0.20.0110.00917.40
8.0.10.0000.00716.89
8.0.00.0140.00616.80
7.4.330.0000.00516.79
7.4.320.0060.00016.41
7.4.300.0040.00416.48
7.4.290.0070.00016.46
7.4.280.0060.00316.58
7.4.270.0040.00416.61
7.4.260.0030.00316.53
7.4.250.0030.00616.59
7.4.240.0040.00416.54
7.4.230.0000.00716.60
7.4.220.0110.00716.53
7.4.210.0060.00916.61
7.4.200.0040.00416.67
7.4.160.0140.00316.48
7.4.150.0100.00917.40
7.4.140.0210.00517.86
7.4.130.0120.00616.58
7.4.120.0100.01016.54
7.4.110.0070.01516.50
7.4.100.0230.00316.43
7.4.90.0080.01516.45
7.4.80.0100.00719.39
7.4.70.0100.01016.73
7.4.60.0130.00316.33
7.4.50.0090.00616.61
7.4.40.0030.01416.63
7.4.30.0120.00616.51
7.4.00.0090.00614.79
7.3.330.0030.00313.26
7.3.320.0000.00613.32
7.3.310.0040.00416.32
7.3.300.0050.00216.35
7.3.290.0100.00816.23
7.3.280.0090.00716.25
7.3.270.0100.01317.40
7.3.260.0180.00016.49
7.3.250.0080.01216.33
7.3.240.0100.01116.32
7.3.230.0060.01616.46
7.3.210.0060.01216.51
7.3.200.0040.01319.39
7.3.190.0100.01316.15
7.3.180.0100.00616.57
7.3.170.0130.01016.36
7.3.160.0100.00716.27
7.3.10.0090.00616.41
7.3.00.0030.01016.57
7.2.330.0120.00616.71
7.2.320.0110.00816.49
7.2.310.0090.00916.67
7.2.300.0070.01116.59
7.2.290.0130.00516.55
7.2.130.0040.00716.85
7.2.120.0030.01316.64
7.2.110.0030.01316.90
7.2.100.0060.00316.84
7.2.90.0000.01516.95
7.2.80.0000.01616.57
7.2.70.0120.00016.82
7.2.60.0050.01016.75
7.2.50.0090.00016.91
7.2.40.0040.01116.83
7.2.30.0030.00916.86
7.2.20.0080.00516.98
7.2.10.0040.01216.93
7.2.00.0080.00617.95
7.1.250.0030.00715.80
7.1.200.0060.00315.84
7.1.100.0050.01117.96
7.1.70.0030.01317.19
7.1.60.0180.00619.27
7.1.50.0000.01316.71
7.1.00.0000.08022.29
7.0.200.0040.00416.70
7.0.60.0130.04021.71
7.0.50.0000.04317.82
7.0.40.0030.08720.18
7.0.30.0170.04020.20
7.0.20.0270.04020.17
7.0.10.0030.04320.34
7.0.00.0070.05320.37
5.6.280.0030.03020.87
5.6.210.0070.05320.69
5.6.200.0030.04318.29
5.6.190.0100.04020.46
5.6.180.0230.06720.77
5.6.170.0300.07020.49
5.6.160.0070.04320.54
5.6.150.0100.06718.21
5.6.140.0070.08718.14
5.6.130.0030.04718.14
5.6.120.0100.04721.03
5.6.110.0100.08721.03
5.6.100.0100.04321.00
5.6.90.0000.09720.98
5.6.80.0130.07020.29
5.5.350.0100.08020.43
5.5.340.0030.06318.03
5.5.330.0100.04720.42
5.5.320.0630.06320.51
5.5.310.0300.05320.32
5.5.300.0100.08017.94
5.5.290.0070.08018.07
5.5.280.0170.08020.89
5.5.270.0030.04320.76
5.5.260.0130.07720.89
5.5.250.0170.07020.58
5.5.240.0070.08720.29

preferences:
56.64 ms | 401 KiB | 5 Q