3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = [ [ 'id' => 2, 'position' => 3, ], [ 'id' => 1, 'position' => 2, ], [ 'id' => 1, 'position' => 1, ], [ 'id' => 2, 'position' => 2, ], [ 'id' => 2, 'position' => 1, ], [ 'id' => 1, 'position' => 3, ], ]; 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.0110.00416.50
8.3.50.0060.00916.38
8.3.40.0090.00618.71
8.3.30.0120.00618.67
8.3.20.0000.00720.00
8.3.10.0040.00421.90
8.3.00.0040.00423.57
8.2.180.0130.01016.36
8.2.170.0150.00022.96
8.2.160.0140.00020.39
8.2.150.0040.00424.18
8.2.140.0150.00324.66
8.2.130.0040.00419.76
8.2.120.0050.00326.35
8.2.110.0030.00722.06
8.2.100.0090.00318.05
8.2.90.0050.00319.17
8.2.80.0020.00718.18
8.2.70.0060.00317.50
8.2.60.0000.00817.93
8.2.50.0040.00418.07
8.2.40.0050.00322.32
8.2.30.0080.00020.55
8.2.20.0000.00817.63
8.2.10.0000.00718.11
8.2.00.0080.00018.00
8.1.280.0180.00325.92
8.1.270.0100.01023.92
8.1.260.0080.00028.09
8.1.250.0080.00028.09
8.1.240.0060.00322.49
8.1.230.0080.00319.14
8.1.220.0040.00417.79
8.1.210.0090.00018.77
8.1.200.0050.00517.36
8.1.190.0050.00317.11
8.1.180.0030.00718.10
8.1.170.0030.00618.49
8.1.160.0000.00820.65
8.1.150.0000.00718.95
8.1.140.0040.00419.48
8.1.130.0030.00317.64
8.1.120.0040.00417.39
8.1.110.0000.00817.51
8.1.100.0070.00017.37
8.1.90.0000.00717.53
8.1.80.0000.00717.46
8.1.70.0030.00317.45
8.1.60.0030.00717.61
8.1.50.0050.00317.48
8.1.40.0040.00417.43
8.1.30.0040.00417.69
8.1.20.0040.00417.65
8.1.10.0030.00617.54
8.1.00.0040.00417.48
8.0.300.0040.00418.77
8.0.290.0050.00216.63
8.0.280.0030.00318.39
8.0.270.0040.00417.27
8.0.260.0000.00617.09
8.0.250.0070.00016.91
8.0.240.0000.00616.82
8.0.230.0030.00316.93
8.0.220.0030.00316.93
8.0.210.0050.00316.86
8.0.200.0050.00216.84
8.0.190.0080.00016.97
8.0.180.0000.00816.91
8.0.170.0000.01016.92
8.0.160.0040.00416.91
8.0.150.0070.00016.89
8.0.140.0070.00016.82
8.0.130.0070.00013.36
8.0.120.0000.00716.89
8.0.110.0050.00316.89
8.0.100.0000.00716.91
8.0.90.0020.00516.93
8.0.80.0030.01316.88
8.0.70.0040.00416.95
8.0.60.0000.00716.93
8.0.50.0050.00316.72
8.0.30.0080.00917.00
8.0.20.0140.00517.40
8.0.10.0000.00716.96
8.0.00.0100.01016.79
7.4.330.0060.00016.67
7.4.320.0000.00716.51
7.4.300.0040.00416.64
7.4.290.0000.00716.64
7.4.280.0000.00916.52
7.4.270.0080.00016.53
7.4.260.0030.00316.41
7.4.250.0030.00516.57
7.4.240.0040.00416.47
7.4.230.0040.00216.46
7.4.220.0110.00716.66
7.4.210.0070.01416.61
7.4.200.0070.00016.38
7.4.160.0070.01116.61
7.4.150.0150.00617.40
7.4.140.0160.01117.86
7.4.130.0110.00916.56
7.4.120.0140.00716.39
7.4.110.0070.01216.50
7.4.100.0060.01216.43
7.4.90.0130.00316.51
7.4.80.0070.01019.39
7.4.70.0060.00916.31
7.4.60.0070.01016.42
7.4.50.0060.00916.19
7.4.40.0090.00916.39
7.4.30.0130.01016.59
7.4.10.0030.01614.63
7.4.00.0060.01014.84
7.3.330.0000.00613.15
7.3.320.0050.00013.29
7.3.310.0030.00316.32
7.3.300.0000.00616.18
7.3.290.0090.00816.19
7.3.280.0070.00916.20
7.3.270.0030.01617.40
7.3.260.0190.00016.28
7.3.250.0110.00716.40
7.3.240.0080.01116.45
7.3.230.0120.00616.39
7.3.210.0160.00716.32
7.3.200.0000.02019.39
7.3.190.0160.00616.59
7.3.180.0170.00716.29
7.3.170.0100.00716.55
7.3.160.0060.00916.57
7.3.130.0040.01414.67
7.3.120.0000.01614.96
7.3.110.0130.00614.64
7.3.100.0100.00315.07
7.3.90.0030.01314.69
7.3.80.0030.00914.66
7.3.70.0060.00914.61
7.3.60.0040.01114.82
7.3.50.0060.00614.53
7.3.40.0060.00914.56
7.3.30.0090.00614.73
7.3.20.0130.00016.64
7.3.10.0040.00416.67
7.3.00.0070.00716.53
7.2.330.0060.01316.38
7.2.320.0130.00616.45
7.2.310.0100.00716.47
7.2.300.0070.01016.63
7.2.290.0030.01916.61
7.2.260.0030.01415.30
7.2.250.0070.01114.67
7.2.240.0090.00614.98
7.2.230.0000.01515.26
7.2.220.0030.01014.59
7.2.210.0080.00814.93
7.2.200.0060.00915.07
7.2.190.0030.01014.84
7.2.180.0100.00315.02
7.2.170.0070.00715.11
7.2.160.0000.01214.91
7.2.150.0070.01016.98
7.2.140.0100.00016.76
7.2.130.0030.01016.82
7.2.120.0070.00316.57
7.2.110.0030.00616.95
7.2.100.0040.01116.82
7.2.90.0030.01016.91
7.2.80.0120.00017.08
7.2.70.0030.00916.63
7.2.60.0030.00816.80
7.2.50.0070.00716.77
7.2.40.0030.01317.07
7.2.30.0030.01016.58
7.2.20.0070.01116.97
7.2.10.0090.00316.84
7.2.00.0050.00618.05
7.1.330.0030.01215.71
7.1.320.0000.01315.84
7.1.310.0000.01215.57
7.1.300.0070.00715.57
7.1.290.0080.00315.74
7.1.280.0030.01315.75
7.1.270.0000.01315.78
7.1.260.0030.01415.62
7.1.250.0070.00715.87
7.1.240.0100.00315.84
7.1.230.0060.00915.79
7.1.220.0040.01115.90
7.1.210.0090.00315.67
7.1.200.0050.00515.73
7.1.190.0030.00715.76
7.1.180.0070.00415.71
7.1.170.0000.01315.92
7.1.160.0030.00715.72
7.1.150.0120.00315.79
7.1.140.0030.00615.96
7.1.130.0060.00615.77
7.1.120.0100.00715.82
7.1.110.0000.01215.55
7.1.100.0030.00816.89
7.1.90.0100.00715.66
7.1.80.0070.01015.60
7.1.70.0060.00516.43
7.1.60.0050.01317.48
7.1.50.0060.00816.14
7.1.40.0030.01015.84
7.1.30.0100.00015.72
7.1.20.0110.00315.69
7.1.10.0090.00615.57
7.1.00.0040.04418.97
7.0.330.0030.00815.19
7.0.320.0040.00415.12
7.0.310.0100.00315.51
7.0.300.0070.00715.49
7.0.290.0030.00715.41
7.0.280.0090.00315.27
7.0.270.0060.00315.32
7.0.260.0030.00914.94
7.0.250.0100.00715.59
7.0.240.0000.01115.20
7.0.230.0070.00715.47
7.0.220.0090.00615.31
7.0.210.0000.00815.52
7.0.200.0000.01216.03
7.0.190.0060.00615.16
7.0.180.0000.01415.51
7.0.170.0000.01215.41
7.0.160.0070.01015.56
7.0.150.0070.00715.48
7.0.140.0080.00715.10
7.0.130.0070.00315.55
7.0.120.0040.01015.52
7.0.110.0070.00715.21
7.0.100.0070.00315.44
7.0.90.0070.00715.49
7.0.80.0090.00015.55
7.0.70.0000.01115.49
7.0.60.0080.03718.67
7.0.50.0070.04716.77
7.0.40.0050.02316.73
7.0.30.0160.02616.75
7.0.20.0180.03916.79
7.0.10.0050.05016.72
7.0.00.0060.02916.90
5.6.400.0030.01014.24
5.6.390.0000.00814.58
5.6.380.0040.00714.40
5.6.370.0000.01014.46
5.6.360.0110.00414.61
5.6.350.0030.00714.20
5.6.340.0040.00814.24
5.6.330.0030.01414.65
5.6.320.0090.00314.38
5.6.310.0040.00814.58
5.6.300.0060.00314.57
5.6.290.0030.00714.13
5.6.280.0060.02317.60
5.6.270.0100.00414.45
5.6.260.0090.00314.27
5.6.250.0070.00714.25
5.6.240.0060.01214.40
5.6.230.0060.01114.34
5.6.220.0000.00814.31
5.6.210.0080.04317.44
5.6.200.0070.03116.23
5.6.190.0050.04517.55
5.6.180.0120.04217.59
5.6.170.0220.04017.41
5.6.160.0070.02317.35
5.6.150.0120.03516.35
5.6.140.0080.04216.24
5.6.130.0060.04516.51
5.6.120.0120.03717.53
5.6.110.0080.03917.60
5.6.100.0130.04217.68
5.6.90.0090.04517.63
5.6.80.0070.02117.37
5.6.70.0110.00414.16
5.6.60.0090.00014.52
5.6.50.0030.00614.21
5.6.40.0060.00614.00
5.6.30.0040.00814.28
5.6.20.0090.00614.59
5.6.10.0040.01214.25
5.6.00.0090.00614.34
5.5.380.0130.00014.47
5.5.370.0040.00714.14
5.5.360.0070.00714.25
5.5.350.0090.03417.18
5.5.340.0060.03416.14
5.5.330.0030.03417.23
5.5.320.0080.02717.18
5.5.310.0080.02817.34
5.5.300.0030.02316.21
5.5.290.0120.03716.12
5.5.280.0110.02317.46
5.5.270.0090.02517.60
5.5.260.0090.02717.49
5.5.250.0110.03017.52
5.5.240.0050.03717.16
5.5.230.0070.00714.40
5.5.220.0030.00614.38
5.5.210.0060.00314.08
5.5.200.0080.00414.18
5.5.190.0060.00614.40
5.5.180.0050.00514.08
5.5.170.0100.00314.24
5.5.160.0000.01514.39
5.5.150.0070.00714.15
5.5.140.0030.00714.39
5.5.130.0030.00814.25
5.5.120.0000.01314.21
5.5.110.0060.00314.19
5.5.100.0060.00614.32
5.5.90.0060.00314.07
5.5.80.0060.00614.05
5.5.70.0060.00914.24
5.5.60.0060.00614.28
5.5.50.0030.01514.21
5.5.40.0100.00714.20
5.5.30.0000.01414.34
5.5.20.0060.01214.36
5.5.10.0100.00314.30
5.5.00.0090.00914.32

preferences:
57.67 ms | 401 KiB | 5 Q