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.0160.00316.75
8.3.50.0120.00721.23
8.3.40.0140.01018.59
8.3.30.0140.00018.75
8.3.20.0040.00420.33
8.3.10.0000.00821.91
8.3.00.0090.00623.64
8.2.180.0090.00616.63
8.2.170.0150.00322.96
8.2.160.0130.00020.58
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0080.00019.82
8.2.120.0080.00026.35
8.2.110.0000.00922.08
8.2.100.0060.00617.93
8.2.90.0080.00019.17
8.2.80.0040.00417.97
8.2.70.0030.00617.63
8.2.60.0030.00618.04
8.2.50.0080.00318.07
8.2.40.0000.00822.15
8.2.30.0080.00019.51
8.2.20.0070.00017.71
8.2.10.0030.00518.07
8.2.00.0040.00718.11
8.1.280.0090.00625.92
8.1.270.0050.00323.71
8.1.260.0030.00728.09
8.1.250.0080.00028.09
8.1.240.0100.00723.88
8.1.230.0040.00819.14
8.1.220.0040.00417.79
8.1.210.0050.00318.77
8.1.200.0060.00317.36
8.1.190.0040.00417.13
8.1.180.0040.00418.10
8.1.170.0050.00318.64
8.1.160.0040.00420.81
8.1.150.0040.00418.81
8.1.140.0060.00319.52
8.1.130.0000.00817.67
8.1.120.0000.00817.43
8.1.110.0000.00717.51
8.1.100.0050.00217.35
8.1.90.0050.00317.45
8.1.80.0000.00717.50
8.1.70.0000.00817.48
8.1.60.0100.00017.64
8.1.50.0030.00617.48
8.1.40.0040.00417.43
8.1.30.0000.00817.59
8.1.20.0030.00617.69
8.1.10.0050.00317.45
8.1.00.0040.00417.49
8.0.300.0020.00518.77
8.0.290.0020.00516.63
8.0.280.0000.00718.30
8.0.270.0000.00717.19
8.0.260.0000.00617.10
8.0.250.0000.00716.84
8.0.240.0030.00316.80
8.0.230.0030.00316.94
8.0.220.0040.00416.86
8.0.210.0000.00716.78
8.0.200.0030.00316.96
8.0.190.0080.00016.95
8.0.180.0080.00016.81
8.0.170.0030.00716.94
8.0.160.0040.00316.73
8.0.150.0000.00716.67
8.0.140.0030.00316.75
8.0.130.0000.00513.31
8.0.120.0040.00416.73
8.0.110.0070.00016.91
8.0.100.0040.00416.87
8.0.90.0000.00716.95
8.0.80.0060.00916.88
8.0.70.0040.00416.95
8.0.60.0020.00516.76
8.0.50.0040.00416.68
8.0.30.0100.00816.96
8.0.20.0160.00617.40
8.0.10.0070.00017.03
8.0.00.0080.01016.81
7.4.330.0050.00016.71
7.4.320.0030.00316.63
7.4.300.0030.00316.55
7.4.290.0030.00316.51
7.4.280.0040.00516.41
7.4.270.0000.00716.54
7.4.260.0000.00716.57
7.4.250.0050.00316.39
7.4.240.0040.00416.55
7.4.230.0020.00516.68
7.4.220.0120.00616.52
7.4.210.0100.01016.46
7.4.200.0040.00416.57
7.4.160.0070.01016.51
7.4.150.0110.00717.40
7.4.140.0110.01117.86
7.4.130.0070.01016.40
7.4.120.0150.00816.46
7.4.110.0080.01216.54
7.4.100.0160.00316.54
7.4.90.0100.00716.58
7.4.80.0140.00819.39
7.4.70.0040.01516.46
7.4.60.0100.00716.36
7.4.50.0090.00616.54
7.4.40.0080.00816.39
7.4.30.0110.01116.59
7.4.00.0070.00914.84
7.3.330.0050.00013.31
7.3.320.0060.00013.30
7.3.310.0030.00316.34
7.3.300.0050.00216.19
7.3.290.0090.00816.22
7.3.280.0110.00516.23
7.3.270.0130.01317.40
7.3.260.0100.00616.32
7.3.250.0060.01416.39
7.3.240.0110.01116.31
7.3.230.0100.00716.39
7.3.210.0030.02116.43
7.3.200.0100.01316.27
7.3.190.0180.00316.35
7.3.180.0000.01616.26
7.3.170.0130.00716.41
7.3.160.0120.00616.48
7.3.120.0060.01214.78
7.3.110.0030.01314.93
7.3.100.0030.01014.74
7.3.90.0060.00314.75
7.3.80.0080.00314.58
7.3.70.0040.00414.76
7.3.60.0000.01514.83
7.3.50.0040.01114.62
7.3.40.0070.00714.66
7.3.30.0000.01614.73
7.3.20.0030.00916.69
7.3.10.0100.00716.64
7.3.00.0120.00016.66
7.2.330.0070.01116.71
7.2.320.0120.00616.75
7.2.310.0060.00916.77
7.2.300.0120.00616.67
7.2.290.0090.00916.38
7.2.250.0030.01315.23
7.2.240.0030.01614.61
7.2.230.0040.00715.01
7.2.220.0070.00714.95
7.2.210.0000.01414.78
7.2.200.0090.00314.81
7.2.190.0040.01114.89
7.2.180.0070.00714.88
7.2.170.0070.00715.05
7.2.60.0120.00316.64
7.2.00.0090.00919.44
7.1.330.0120.00315.91
7.1.320.0060.00615.84
7.1.310.0040.01115.74
7.1.300.0090.00315.91
7.1.290.0090.00615.65
7.1.280.0030.01315.44
7.1.270.0030.00615.66
7.1.260.0040.01115.82
7.1.200.0040.00815.74
7.1.100.0000.01118.34
7.1.70.0000.00816.85
7.1.60.0110.01419.27
7.1.50.0040.00716.99
7.1.00.0030.07722.54
7.0.200.0000.00816.66
7.0.60.0130.07721.63
7.0.50.0070.03717.86
7.0.40.0130.04720.27
7.0.30.0230.03320.22
7.0.20.0330.08320.09
7.0.10.0000.05720.16
7.0.00.0070.08020.14
5.6.280.0030.04721.08
5.6.210.0070.08020.63
5.6.200.0100.06718.19
5.6.190.0100.07720.49
5.6.180.0130.05720.41
5.6.170.0270.07020.71
5.6.160.0070.04020.55
5.6.150.0070.06018.19
5.6.140.0030.06018.28
5.6.130.0070.07318.24
5.6.120.0070.04721.14
5.6.110.0130.07021.00
5.6.100.0100.08021.12
5.6.90.0000.06021.11
5.6.80.0170.07020.40
5.5.350.0100.07720.52
5.5.340.0070.04018.02
5.5.330.0030.06320.41
5.5.320.0630.07320.33
5.5.310.0300.04320.23
5.5.300.0070.04018.08
5.5.290.0100.06718.04
5.5.280.0170.05320.80
5.5.270.0070.04020.80
5.5.260.0100.06320.89
5.5.250.0030.06720.79
5.5.240.0100.07720.04

preferences:
102.04 ms | 401 KiB | 5 Q