3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myClass { private $a = [ 'foo-test' => [1], '-' => [2], 'bar-test' => [3] ]; private function _mySort($x, $y) { print_r($this->a); if (!isset($this->a[$x])) { throw new Exception('Missing X: "' . $x . '"'); } if (!isset($this->a[$y])) { throw new Exception('Missing Y: "' . $y . '"'); } return ($x == 'foo-test' ? -1 : ($x == 'bar-test' ? 1 : 0)); } public function __construct() { uksort($this->a, [$this, '_mySort']); } } new myClass();

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.0070.01116.63
8.3.50.0100.01016.47
8.3.40.0060.00918.49
8.3.30.0180.00418.70
8.3.20.0040.00420.08
8.3.10.0070.00023.66
8.3.00.0080.00023.45
8.2.180.0140.00716.38
8.2.170.0100.01022.96
8.2.160.0100.00320.48
8.2.150.0070.00024.18
8.2.140.0050.00324.66
8.2.130.0040.00420.97
8.2.120.0080.00026.35
8.2.110.0090.00020.99
8.2.100.0040.00817.93
8.2.90.0040.00419.17
8.2.80.0030.00517.97
8.2.70.0030.00617.63
8.2.60.0040.00418.05
8.2.50.0070.00818.09
8.2.40.0070.00321.93
8.2.30.0080.00019.41
8.2.20.0090.00017.78
8.2.10.0040.00418.03
8.2.00.0040.00418.13
8.1.280.0100.00325.92
8.1.270.0060.01222.07
8.1.260.0000.00728.09
8.1.250.0040.00428.09
8.1.240.0090.00320.80
8.1.230.0080.00319.16
8.1.220.0080.00017.74
8.1.210.0080.00018.77
8.1.200.0060.00317.36
8.1.190.0050.00317.35
8.1.180.0000.00818.10
8.1.170.0030.00718.46
8.1.160.0040.00420.66
8.1.150.0030.00318.95
8.1.140.0060.00319.53
8.1.130.0030.00317.64
8.1.120.0000.00817.38
8.1.110.0040.00417.43
8.1.100.0000.00717.48
8.1.90.0050.00217.43
8.1.80.0040.00417.32
8.1.70.0030.00317.38
8.1.60.0040.00417.58
8.1.50.0040.00417.51
8.1.40.0040.00817.49
8.1.30.0030.00617.45
8.1.20.0040.00417.58
8.1.10.0000.00717.44
8.1.00.0000.00817.40
8.0.300.0000.00718.77
8.0.290.0040.00416.88
8.0.280.0030.00318.46
8.0.270.0000.00717.28
8.0.260.0060.00017.32
8.0.250.0030.00316.95
8.0.240.0080.00017.11
8.0.230.0000.00716.92
8.0.220.0030.00316.88
8.0.210.0030.00316.82
8.0.200.0060.00016.92
8.0.190.0000.00716.89
8.0.180.0040.00416.84
8.0.170.0000.00816.77
8.0.160.0030.00316.83
8.0.150.0000.00716.86
8.0.140.0040.00416.86
8.0.130.0030.00313.31
8.0.120.0050.00316.84
8.0.110.0050.00316.89
8.0.100.0000.00716.70
8.0.90.0000.00716.72
8.0.80.0030.01116.73
8.0.70.0020.00516.70
8.0.60.0040.00416.88
8.0.50.0020.00516.82
8.0.30.0130.00817.06
8.0.20.0110.00817.40
8.0.10.0040.00417.03
8.0.00.0110.01116.82
7.4.330.0050.00016.76
7.4.320.0030.00316.59
7.4.300.0030.00316.36
7.4.290.0000.00716.57
7.4.280.0050.00316.56
7.4.270.0070.00016.49
7.4.260.0070.00016.45
7.4.250.0070.00016.42
7.4.240.0030.00516.48
7.4.230.0030.00316.21
7.4.220.0090.01216.43
7.4.210.0060.00916.61
7.4.200.0000.00716.46
7.4.160.0130.00316.35
7.4.150.0070.01017.40
7.4.140.0090.01117.86
7.4.130.0090.00916.55
7.4.120.0070.00916.48
7.4.110.0100.01016.59
7.4.100.0000.01716.54
7.4.90.0110.01116.29
7.4.80.0110.01019.39
7.4.70.0030.01316.58
7.4.60.0100.00716.47
7.4.50.0030.00916.41
7.4.40.0060.01016.55
7.4.30.0110.01116.41
7.4.00.0050.01114.91
7.3.330.0040.00413.34
7.3.320.0000.00513.18
7.3.310.0040.00416.38
7.3.300.0040.00416.13
7.3.290.0000.00716.20
7.3.280.0120.00516.32
7.3.270.0090.00917.40
7.3.260.0090.00916.57
7.3.250.0090.00816.40
7.3.240.0180.00016.31
7.3.230.0100.01016.39
7.3.210.0100.01016.68
7.3.200.0140.00519.39
7.3.190.0110.00516.57
7.3.180.0100.00716.54
7.3.170.0070.01016.56
7.3.160.0090.00616.45
7.3.120.0110.00514.84
7.3.110.0060.00914.57
7.3.100.0020.01414.79
7.3.90.0130.00014.74
7.3.80.0020.00914.83
7.3.70.0080.00314.94
7.3.60.0070.00714.86
7.3.50.0050.00914.71
7.3.40.0070.00614.86
7.3.30.0040.01114.78
7.3.20.0070.00716.62
7.3.10.0020.00916.63
7.3.00.0080.00216.70
7.2.330.0040.01316.86
7.2.320.0100.01416.45
7.2.310.0120.00416.76
7.2.300.0110.00716.57
7.2.290.0040.01216.55
7.2.250.0080.00814.98
7.2.240.0090.00815.26
7.2.230.0080.00815.02
7.2.220.0040.01115.10
7.2.210.0100.00415.13
7.2.200.0080.00714.99
7.2.190.0080.00915.12
7.2.180.0060.00514.97
7.2.170.0050.00714.73
7.2.160.0100.00415.05
7.2.150.0040.00716.96
7.2.140.0070.00716.83
7.2.130.0040.01117.03
7.2.120.0040.00717.06
7.2.110.0090.00616.90
7.2.100.0000.01116.64
7.2.90.0000.01716.97
7.2.80.0090.00616.97
7.2.70.0060.00916.87
7.2.60.0040.00917.06
7.2.50.0040.01116.84
7.2.40.0000.01216.94
7.2.30.0030.01216.79
7.2.20.0100.00616.86
7.2.10.0090.00616.76
7.2.00.0060.00618.20
7.1.330.0060.00915.85
7.1.320.0050.00815.79
7.1.310.0030.00815.84
7.1.300.0050.00715.85
7.1.290.0050.00715.90
7.1.280.0030.01015.66
7.1.270.0050.00715.73
7.1.260.0060.00515.82
7.1.250.0100.00615.85
7.1.200.0000.01215.48
7.1.100.0070.00718.14
7.1.70.0040.00417.16
7.1.60.0060.01919.40
7.1.50.0080.00416.79
7.1.00.0070.07322.33
7.0.200.0590.00614.60
7.0.60.0070.03721.63
7.0.50.0200.04317.97
7.0.40.0070.05020.19
7.0.30.0300.07320.23
7.0.20.0270.03720.15
7.0.10.0070.05720.15
7.0.00.0070.08720.37
5.6.280.0000.03721.11
5.6.210.0200.06320.49
5.6.200.0030.04318.13
5.6.190.0100.08320.77
5.6.180.0270.04720.52
5.6.170.0200.05720.59
5.6.160.0070.06320.44
5.6.150.0070.04718.29
5.6.140.0030.08318.15
5.6.130.0200.03318.27
5.6.120.0100.05321.00
5.6.110.0170.07021.02
5.6.100.0070.07720.98
5.6.90.0130.06021.09
5.6.80.0070.07020.45
5.5.350.0000.07020.43
5.5.340.0100.08018.01
5.5.330.0030.08020.21
5.5.320.0200.08720.34
5.5.310.0230.08320.24
5.5.300.0100.08017.99
5.5.290.0070.07318.00
5.5.280.0100.04021.00
5.5.270.0000.09320.77
5.5.260.0070.09020.87
5.5.250.0030.04020.50
5.5.240.0130.02720.28

preferences:
77.69 ms | 400 KiB | 5 Q