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, function($a, $b) use ($priorities) { return $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.0090.01220.50
8.4.110.0080.01218.92
8.4.100.0060.00420.77
8.4.90.0100.01018.82
8.4.80.0080.00518.09
8.4.70.0050.00417.96
8.4.60.0080.00318.98
8.4.50.0090.01117.55
8.4.40.0130.00720.47
8.4.30.0130.00620.41
8.4.20.0100.01017.84
8.4.10.0060.00319.57
8.3.250.0110.00918.87
8.3.240.0030.00516.83
8.3.230.0100.01016.84
8.3.220.0090.01018.66
8.3.210.0120.00616.55
8.3.200.0050.00416.43
8.3.190.0020.00617.18
8.3.180.0060.01318.59
8.3.170.0060.01216.73
8.3.160.0120.00616.57
8.3.150.0120.00616.92
8.3.140.0030.01517.36
8.3.130.0060.00318.54
8.3.120.0060.01220.46
8.3.110.0090.00020.94
8.3.100.0120.00316.63
8.3.90.0080.00026.77
8.3.80.0050.00519.36
8.3.70.0110.01118.55
8.3.60.0060.00918.52
8.3.50.0080.00523.57
8.3.40.0190.00418.92
8.3.30.0110.00718.67
8.3.20.0040.00420.76
8.3.10.0050.00320.29
8.3.00.0040.00421.95
8.2.290.0110.00720.38
8.2.280.0080.00418.30
8.2.270.0030.01019.20
8.2.260.0040.00419.15
8.2.250.0040.00416.63
8.2.240.0050.00518.65
8.2.230.0040.00422.58
8.2.220.0100.00624.06
8.2.210.0130.00626.77
8.2.200.0000.00818.88
8.2.190.0100.01016.58
8.2.180.0110.01118.08
8.2.170.0140.00718.95
8.2.160.0080.00822.96
8.2.150.0000.00925.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00421.18
8.2.110.0090.00020.39
8.2.100.0040.00817.66
8.2.90.0030.00618.00
8.2.80.0000.00817.97
8.2.70.0030.00617.91
8.2.60.0040.00418.16
8.2.50.0080.00018.10
8.2.40.0040.00419.42
8.2.30.0040.00419.24
8.2.20.0000.00718.05
8.2.10.0000.00919.27
8.2.00.0000.00719.29
8.1.330.0110.00821.98
8.1.320.0130.00716.22
8.1.310.0040.00416.79
8.1.300.0130.00319.93
8.1.290.0030.00630.84
8.1.280.0100.01025.92
8.1.270.0000.00820.60
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0070.00422.19
8.1.230.0060.00623.86
8.1.220.0040.00417.74
8.1.210.0070.00418.77
8.1.200.0050.00517.23
8.1.190.0030.00617.23
8.1.180.0050.00319.04
8.1.170.0000.00818.61
8.1.160.0040.00419.00
8.1.150.0070.00018.93
8.1.140.0040.00422.02
8.1.130.0030.00320.18
8.1.120.0040.00417.48
8.1.110.0000.00717.36
8.1.100.0080.00017.34
8.1.90.0000.00717.34
8.1.80.0000.00817.43
8.1.70.0090.00017.49
8.1.60.0050.00317.59
8.1.50.0040.00717.50
8.1.40.0000.00917.54
8.1.30.0040.00417.57
8.1.20.0040.00417.54
8.1.10.0000.00717.61
8.1.00.0000.00917.51
8.0.300.0000.00720.00
8.0.290.0070.00016.75
8.0.280.0050.00318.43
8.0.270.0000.00716.79
8.0.260.0000.00620.13
8.0.250.0000.00717.05
8.0.240.0030.00316.91
8.0.230.0050.00317.00
8.0.220.0000.00716.99
8.0.210.0030.00316.97
8.0.200.0000.00616.84
8.0.190.0040.00416.82
8.0.180.0040.00416.96
8.0.170.0050.00316.91
8.0.160.0050.00316.87
8.0.150.0050.00316.71
8.0.140.0080.00016.86
8.0.130.0050.00013.41
8.0.120.0000.00716.75
8.0.110.0000.00716.75
8.0.100.0040.00416.96
8.0.90.0030.00616.78
8.0.80.0090.00916.88
8.0.70.0040.00416.89
8.0.60.0000.00716.77
8.0.50.0020.00516.88
8.0.30.0150.00416.99
8.0.20.0090.01217.17
8.0.10.0050.00316.97
8.0.00.0090.01116.74
7.4.330.0050.00015.55
7.4.320.0000.00616.50
7.4.300.0000.00716.60
7.4.290.0080.00016.61
7.4.280.0030.00316.53
7.4.270.0070.00016.58
7.4.260.0040.00313.19
7.4.250.0030.00316.41
7.4.240.0020.00616.61
7.4.230.0000.00716.48
7.4.220.0030.00416.43
7.4.210.0090.00916.54
7.4.200.0070.00016.44
7.4.130.0080.01116.36
7.4.120.0160.00316.39
7.4.110.0140.00316.73
7.4.100.0140.00516.59
7.4.90.0070.01016.42
7.4.80.0090.00919.39
7.4.70.0070.00916.44
7.4.60.0120.00916.58
7.4.50.0150.00016.33
7.4.40.0110.00716.37
7.4.10.0130.00615.06
7.4.00.0070.01114.92
7.3.330.0060.00516.25
7.3.320.0050.00013.39
7.3.310.0030.00316.51
7.3.300.0030.00416.26
7.3.290.0030.01216.30
7.3.280.0120.00816.32
7.3.260.0100.00616.35
7.3.240.0100.00716.43
7.3.230.0060.01016.42
7.3.210.0060.01016.27
7.3.200.0070.01016.41
7.3.190.0130.00316.30
7.3.180.0090.00916.49
7.3.170.0090.01216.50
7.3.160.0120.00316.48
7.3.130.0070.01314.73
7.3.120.0050.01414.84
7.3.110.0120.00214.81
7.3.100.0080.01014.87
7.3.90.0120.00614.92
7.3.80.0060.01014.59
7.3.70.0100.00514.85
7.3.60.0060.00614.87
7.3.50.0090.00914.80
7.3.40.0090.00814.60
7.3.30.0080.00814.83
7.3.20.0060.00715.72
7.3.10.0090.00715.71
7.3.00.0070.00615.49
7.2.330.0070.01016.65
7.2.320.0150.00316.40
7.2.310.0100.00716.71
7.2.300.0090.01316.63
7.2.290.0070.01016.56
7.2.260.0030.01715.02
7.2.250.0100.00914.93
7.2.240.0100.00714.81
7.2.230.0030.01215.18
7.2.220.0120.00715.02
7.2.210.0050.01115.08
7.2.200.0070.00815.00
7.2.190.0070.00914.78
7.2.180.0100.00814.97
7.2.170.0080.00814.71
7.2.160.0040.00815.14
7.2.150.0040.01117.01
7.2.140.0030.00916.94
7.2.130.0130.00016.99
7.2.120.0090.00617.11
7.2.110.0100.00717.07
7.2.100.0120.00316.85
7.2.90.0030.00616.96
7.2.80.0040.01216.96
7.2.70.0060.00617.02
7.2.60.0040.01117.02
7.2.50.0090.00616.64
7.2.40.0090.00616.86
7.2.30.0060.00916.82
7.2.20.0060.00916.59
7.2.10.0040.01116.95
7.2.00.0030.01316.66
7.1.330.0000.01514.01
7.1.320.0090.00913.79
7.1.310.0100.01013.87
7.1.300.0060.00613.80
7.1.290.0080.00813.78
7.1.280.0030.01713.75
7.1.270.0000.01313.95
7.1.260.0110.00713.83
7.0.330.0190.00817.88

preferences:
76.85 ms | 403 KiB | 5 Q