3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['id' => 7867867, 'animal' => 'Dog'], ['id' => 3452342, 'animal' => 'Lion'], ['id' => 1231233, 'animal' => 'Lion'], ['id' => 5867867, 'animal' => 'Dog'], ['id' => 1111111, 'animal' => 'Zeebra'], ['id' => 2222222, 'animal' => 'Cat'], ['id' => 3333333, 'animal' => 'Cat'], ['id' => 4444444, 'animal' => 'Zeebra'] ]; $priorities = array_flip(['Lion', 'Dog', 'Zeebra', 'Cat']); usort($array, fn($a, $b) => $priorities[$a['animal']] <=> $priorities[$b['animal']]); 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.4.120.0050.00424.00
8.4.110.0130.00720.72
8.4.100.0120.00917.86
8.4.90.0130.00720.36
8.4.80.0140.00618.94
8.4.70.0060.00519.06
8.4.60.0100.01118.59
8.4.50.0100.01117.97
8.4.40.0130.00720.50
8.4.30.0150.00420.48
8.4.20.0080.00017.83
8.4.10.0170.00319.89
8.3.250.0110.00818.87
8.3.240.0110.00717.13
8.3.230.0100.00916.72
8.3.220.0080.00618.95
8.3.210.0090.01016.72
8.3.200.0050.00416.62
8.3.190.0040.00516.74
8.3.180.0150.00616.67
8.3.170.0040.00418.80
8.3.160.0070.01118.37
8.3.150.0070.01017.16
8.3.140.0050.00316.60
8.3.130.0040.00416.80
8.3.120.0030.00618.91
8.3.110.0080.00020.94
8.3.100.0150.00018.72
8.3.90.0130.00726.77
8.3.80.0030.00919.36
8.3.70.0110.00716.75
8.3.60.0140.00718.68
8.3.50.0070.01123.67
8.3.40.0070.01418.62
8.3.30.0100.01018.53
8.3.20.0140.00320.95
8.3.10.0120.00320.19
8.3.00.0070.01121.85
8.2.290.0090.00920.55
8.2.280.0070.00816.57
8.2.270.0070.01117.07
8.2.260.0040.00417.05
8.2.250.0140.00416.59
8.2.240.0080.00018.96
8.2.230.0070.00322.58
8.2.220.0050.00524.06
8.2.210.0040.00426.77
8.2.200.0030.00618.88
8.2.190.0080.00816.58
8.2.180.0140.00718.42
8.2.170.0040.01122.96
8.2.160.0070.01320.43
8.2.150.0040.00425.66
8.2.140.0090.00624.66
8.2.130.0070.01126.16
8.2.120.0120.00626.16
8.2.110.0040.00422.26
8.2.100.0060.00617.78
8.2.90.0090.00017.63
8.2.80.0080.00018.60
8.2.70.0040.00417.50
8.2.60.0050.00317.63
8.2.50.0000.00817.63
8.2.40.0050.00219.30
8.2.30.0050.00317.75
8.2.20.0000.00718.00
8.2.10.0080.00019.18
8.2.00.0000.00719.37
8.1.330.0090.01221.72
8.1.320.0120.00718.17
8.1.310.0090.00916.71
8.1.300.0030.00617.92
8.1.290.0090.00030.84
8.1.280.0110.00625.92
8.1.270.0040.00420.70
8.1.260.0120.00626.35
8.1.250.0080.00028.09
8.1.240.0120.00918.82
8.1.230.0000.01022.07
8.1.220.0050.00317.74
8.1.210.0030.00518.77
8.1.200.0030.00517.35
8.1.190.0000.00917.35
8.1.180.0030.00518.10
8.1.170.0050.00318.64
8.1.160.0000.00822.67
8.1.150.0030.00518.83
8.1.140.0000.00722.09
8.1.130.0070.00020.06
8.1.120.0000.00717.48
8.1.110.0040.00417.48
8.1.100.0040.00417.30
8.1.90.0050.00317.41
8.1.80.0000.00817.36
8.1.70.0030.00517.36
8.1.60.0040.00417.56
8.1.50.0030.00617.52
8.1.40.0040.00717.53
8.1.30.0080.00017.70
8.1.20.0070.00017.69
8.1.10.0040.00417.64
8.1.00.0040.00417.52
8.0.300.0040.00418.77
8.0.290.0050.00316.75
8.0.280.0040.00418.52
8.0.270.0080.00017.98
8.0.260.0030.00320.07
8.0.250.0070.00017.02
8.0.240.0030.00316.91
8.0.230.0070.00016.99
8.0.220.0000.00616.87
8.0.210.0050.00316.84
8.0.200.0030.00316.95
8.0.190.0000.00816.91
8.0.180.0040.00416.87
8.0.170.0030.00616.95
8.0.160.0060.00316.97
8.0.150.0040.00416.89
8.0.140.0040.00416.87
8.0.130.0030.00313.28
8.0.120.0040.00416.77
8.0.110.0040.00416.76
8.0.100.0080.00016.75
8.0.90.0000.00816.89
8.0.80.0080.00716.89
8.0.70.0070.00016.84
8.0.60.0000.00716.69
8.0.50.0040.00416.77
8.0.30.0060.01217.15
8.0.20.0120.00917.33
8.0.10.0040.00416.93
8.0.00.0120.00616.48
7.4.330.0050.00015.55
7.4.320.0060.00016.51
7.4.300.0030.00316.55
7.4.290.0040.00416.61
7.4.280.0040.00416.41
7.4.270.0000.00816.50
7.4.260.0040.00413.27
7.4.250.0040.00316.46
7.4.240.0050.00316.46
7.4.230.0040.00416.62
7.4.220.0050.00216.64
7.4.210.0080.01016.64
7.4.200.0040.00416.59
7.4.130.0090.00916.51
7.4.120.0060.01216.66
7.4.110.0130.00716.59
7.4.100.0100.01016.54
7.4.90.0060.00916.38
7.4.80.0040.01219.39
7.4.70.0050.01116.57
7.4.60.0070.01016.52
7.4.50.0070.00716.51
7.4.40.0130.00316.27
7.4.10.0080.00815.00
7.4.00.0080.01014.97
7.3.330.0070.00016.24
7.3.320.0030.00313.21
7.3.310.0030.00316.26
7.3.300.0000.00716.00
7.3.290.0060.00816.21
7.3.280.0070.00816.12
7.3.260.0100.01316.41
7.3.240.0120.00516.22
7.3.230.0060.00916.21
7.3.210.0090.00616.32
7.3.200.0140.00316.22
7.3.190.0120.01216.25
7.3.180.0070.01016.29
7.3.170.0120.00616.35
7.3.160.0060.00916.19
7.3.130.0070.01014.82
7.3.120.0110.00314.68
7.3.110.0080.00814.60
7.3.100.0080.00714.76
7.3.90.0050.00814.63
7.3.80.0030.01114.55
7.3.70.0050.00914.68
7.3.60.0040.01314.52
7.3.50.0100.00314.64
7.3.40.0090.00814.73
7.3.30.0100.00414.70
7.3.20.0090.00815.60
7.3.10.0080.01015.59
7.3.00.0080.00815.66
7.2.330.0040.01516.20
7.2.320.0120.00616.52
7.2.310.0150.00616.14
7.2.300.0060.01616.39
7.2.290.0100.01016.27
7.2.260.0060.01214.87
7.2.250.0040.01314.84
7.2.240.0020.01414.70
7.2.230.0080.00814.97
7.2.220.0110.00514.98
7.2.210.0060.01014.65
7.2.200.0070.00714.66
7.2.190.0050.00814.56
7.2.180.0050.01014.68
7.2.170.0050.00814.66
7.2.160.0040.00714.66
7.2.150.0070.01016.57
7.2.140.0030.00616.94
7.2.130.0040.00816.42
7.2.120.0070.00416.68
7.2.110.0030.00916.69
7.2.100.0040.00816.74
7.2.90.0060.01317.00
7.2.80.0100.00616.86
7.2.70.0000.01416.91
7.2.60.0000.01516.82
7.2.50.0090.00916.38
7.2.40.0000.01816.72
7.2.30.0110.00716.87
7.2.20.0100.00316.66
7.2.10.0040.01216.44
7.2.00.0130.00316.79
7.1.330.0080.00713.82
7.1.320.0130.00313.65
7.1.310.0070.00713.54
7.1.300.0040.00913.66
7.1.290.0180.00613.72
7.1.280.0060.00913.75
7.1.270.0030.01013.75
7.1.260.0150.00513.89

preferences:
15.79 ms | 403 KiB | 5 Q