3v4l.org

run code in 300+ PHP versions simultaneously
<?php $template = ['A', 'B', 'C']; $myArray = [ new Element('B'), new Element('C'), new Element('A'), ]; class Element { public $name; public function __construct($name) { $this->name = $name; } } usort($myArray, function($a, $b) { return array_search($a) - array_search($b); }); var_dump($myArray);

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.0040.01116.61
8.3.50.0150.00521.25
8.3.40.0070.00718.78
8.3.30.0070.00718.84
8.3.20.0070.00020.23
8.3.10.0040.00423.61
8.3.00.0050.00319.79
8.2.180.0120.00918.26
8.2.170.0090.00922.96
8.2.160.0030.01020.35
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0060.00317.75
8.2.110.0150.00022.25
8.2.100.0040.00817.75
8.2.90.0020.00519.40
8.2.80.0080.00017.97
8.2.70.0040.00417.63
8.2.60.0040.00417.79
8.2.50.0050.00318.07
8.2.40.0080.00019.23
8.2.30.0080.00019.86
8.2.20.0050.00317.64
8.2.10.0000.00818.14
8.2.00.0040.00418.04
8.1.280.0130.00725.92
8.1.270.0040.00420.38
8.1.260.0070.00026.35
8.1.250.0080.00028.09
8.1.240.0000.00822.67
8.1.230.0100.00317.42
8.1.220.0080.00017.75
8.1.210.0090.00018.77
8.1.200.0000.00917.35
8.1.190.0050.00317.38
8.1.180.0040.00418.10
8.1.170.0050.00318.64
8.1.160.0040.00422.04
8.1.150.0040.00418.92
8.1.140.0080.00317.39
8.1.130.0030.00317.70
8.1.120.0040.00417.56
8.1.110.0070.00017.45
8.1.100.0030.00517.52
8.1.90.0030.00517.39
8.1.80.0000.00817.41
8.1.70.0060.00317.43
8.1.60.0080.00017.50
8.1.50.0030.00517.52
8.1.40.0060.00317.47
8.1.30.0030.00917.60
8.1.20.0040.00417.53
8.1.10.0050.00317.59
8.1.00.0070.00017.38
8.0.300.0030.00918.77
8.0.290.0000.00716.88
8.0.280.0090.00018.43
8.0.270.0030.00317.39
8.0.260.0070.00017.29
8.0.250.0040.00416.94
8.0.240.0000.00616.96
8.0.230.0060.00316.94
8.0.220.0000.00717.04
8.0.210.0000.00816.92
8.0.200.0030.00517.05
8.0.190.0040.00416.93
8.0.180.0000.00717.03
8.0.170.0060.00316.84
8.0.160.0040.00416.93
8.0.150.0000.00716.81
8.0.140.0040.00416.91
8.0.130.0070.00013.38
8.0.120.0090.00016.82
8.0.110.0050.00316.88
8.0.100.0000.00816.91
8.0.90.0070.00016.99
8.0.80.0040.01316.91
8.0.70.0040.00416.94
8.0.60.0040.00417.02
8.0.50.0000.00816.78
8.0.30.0050.01417.09
8.0.20.0120.00917.40
8.0.10.0000.00716.91
8.0.00.0050.01616.81
7.4.330.0000.00515.13
7.4.320.0000.00616.64
7.4.300.0040.00416.53
7.4.290.0030.00316.41
7.4.280.0000.00716.61
7.4.270.0000.00716.55
7.4.260.0030.00316.61
7.4.250.0000.00716.48
7.4.240.0000.00716.48
7.4.230.0000.00816.70
7.4.220.0130.00616.61
7.4.210.0040.01116.62
7.4.200.0000.00716.67
7.4.160.0060.00916.48
7.4.150.0210.00317.40
7.4.140.0120.00717.86
7.4.130.0140.00516.58
7.4.120.0070.01016.59
7.4.110.0110.00716.66
7.4.100.0150.00616.57
7.4.90.0130.00516.55
7.4.80.0150.00419.39
7.4.70.0030.01416.33
7.4.60.0070.01416.41
7.4.50.0060.00016.60
7.4.40.0100.00716.78
7.4.30.0150.00416.58
7.4.00.0030.01415.16
7.3.330.0050.00013.32
7.3.320.0000.00513.36
7.3.310.0000.00816.22
7.3.300.0000.00616.27
7.3.290.0090.01116.37
7.3.280.0100.01616.32
7.3.270.0170.00717.40
7.3.260.0150.00316.54
7.3.250.0100.00716.33
7.3.240.0110.01116.38
7.3.230.0120.00616.39
7.3.210.0030.01316.33
7.3.200.0200.00016.36
7.3.190.0070.01016.38
7.3.180.0080.00816.44
7.3.170.0110.00616.53
7.3.160.0130.00616.59
7.2.330.0100.00816.76
7.2.320.0110.01516.74
7.2.310.0110.00616.78
7.2.300.0090.00916.57
7.2.290.0110.00716.34
7.2.60.0070.00716.88
7.2.00.0120.00619.05
7.1.200.0040.00915.62
7.1.100.0030.00917.97
7.1.70.0000.00916.94
7.1.60.0090.01319.27
7.1.50.0040.01816.63
7.1.00.0070.04722.36
7.0.200.0110.00316.47
7.0.60.0100.07719.96
7.0.50.0130.06717.85
7.0.40.0070.07320.11
7.0.30.0330.05020.16
7.0.20.0270.08020.08
7.0.10.0130.05720.15
7.0.00.0130.06320.25
5.6.280.0170.05021.10
5.6.210.0030.05720.65
5.6.200.0000.07318.21
5.6.190.0100.05320.50
5.6.180.0330.07020.48
5.6.170.0400.05720.59
5.6.160.0130.07020.48
5.6.150.0070.04718.18
5.6.140.0100.03318.22
5.6.130.0030.08718.21
5.6.120.0130.06321.06
5.6.110.0130.06320.98
5.6.100.0070.08321.14
5.6.90.0100.08020.97
5.6.80.0130.07020.29
5.6.70.4300.03720.37
5.5.350.0200.03320.50
5.5.340.0130.08017.95
5.5.330.0100.03720.44
5.5.320.0270.06020.36
5.5.310.0230.08320.27
5.5.300.0100.07017.98
5.5.290.0170.07017.94
5.5.280.0070.07020.77
5.5.270.0070.08320.73
5.5.260.0070.08320.80
5.5.250.0070.08020.72
5.5.240.0030.06720.26
5.4.450.0630.06319.40
5.4.440.0670.06019.46
5.4.430.0630.07719.61
5.4.420.0770.05019.33
5.4.410.0670.05319.30
5.4.400.0700.05019.29
5.4.390.0770.04718.98
5.4.380.0800.04018.84
5.4.370.0700.05719.29
5.4.360.0530.05719.25
5.4.350.0600.06019.38
5.4.340.0570.06019.37
5.4.320.0730.04719.26
5.4.310.0630.06019.08
5.4.300.0700.05319.12
5.4.290.0730.05319.28
5.4.280.0670.05719.23
5.4.270.0600.05319.16
5.4.260.0730.06319.05
5.4.250.0870.04319.27
5.4.240.0700.05318.97
5.4.230.0700.04719.27
5.4.220.0730.04719.22
5.4.210.0670.05019.36
5.4.200.0700.05019.20
5.4.190.0700.05718.86
5.4.180.0700.05719.27
5.4.170.0570.05318.86
5.4.160.0730.05019.26
5.4.150.0770.04318.82
5.4.140.0770.04316.34
5.4.130.0730.04316.55
5.4.120.0770.04716.41
5.4.110.0670.06016.28
5.4.100.0770.04716.28
5.4.90.0700.05716.61
5.4.80.0630.05316.27
5.4.70.0230.05716.54
5.4.60.0370.05316.51
5.4.50.0070.03316.52
5.4.40.0030.05716.54
5.4.30.0000.07016.43
5.4.20.0070.06316.51

preferences:
57.87 ms | 401 KiB | 5 Q