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.0090.00916.75
8.3.50.0140.00421.17
8.3.40.0040.01118.82
8.3.30.0040.01818.79
8.3.20.0050.00320.34
8.3.10.0040.00423.55
8.3.00.0080.00023.57
8.2.180.0140.00716.63
8.2.170.0030.01722.96
8.2.160.0030.01020.47
8.2.150.0000.00825.66
8.2.140.0070.00024.66
8.2.130.0050.00321.07
8.2.120.0000.00726.35
8.2.110.0150.00619.31
8.2.100.0030.00917.93
8.2.90.0030.00519.21
8.2.80.0040.00417.97
8.2.70.0000.00917.50
8.2.60.0040.00417.89
8.2.50.0100.00018.09
8.2.40.0050.00322.14
8.2.30.0000.00819.58
8.2.20.0040.00417.64
8.2.10.0040.00418.07
8.2.00.0080.00018.16
8.1.280.0070.00725.92
8.1.270.0040.00422.19
8.1.260.0040.00428.09
8.1.250.0070.00028.09
8.1.240.0110.00722.17
8.1.230.0070.00417.82
8.1.220.0040.00417.79
8.1.210.0030.00618.77
8.1.200.0030.00617.48
8.1.190.0030.00617.22
8.1.180.0030.00618.10
8.1.170.0030.00718.57
8.1.160.0000.00720.79
8.1.150.0030.00319.04
8.1.140.0000.00819.66
8.1.130.0000.00717.80
8.1.120.0030.00317.39
8.1.110.0040.00417.43
8.1.100.0040.00417.32
8.1.90.0040.00417.46
8.1.80.0050.00317.43
8.1.70.0070.00017.44
8.1.60.0000.00717.47
8.1.50.0090.00017.48
8.1.40.0030.00617.45
8.1.30.0030.00617.57
8.1.20.0060.00317.52
8.1.10.0050.00217.43
8.1.00.0000.00817.33
8.0.300.0080.00018.77
8.0.290.0040.00416.75
8.0.280.0000.00818.34
8.0.270.0000.00717.19
8.0.260.0000.00617.29
8.0.250.0000.00717.03
8.0.240.0040.00417.00
8.0.230.0070.00016.95
8.0.220.0030.00316.84
8.0.210.0000.00716.88
8.0.200.0070.00016.96
8.0.190.0080.00016.86
8.0.180.0070.00016.90
8.0.170.0070.00016.92
8.0.160.0000.00716.95
8.0.150.0040.00416.85
8.0.140.0040.00416.80
8.0.130.0030.00313.30
8.0.120.0000.00816.88
8.0.110.0040.00416.77
8.0.100.0000.00716.84
8.0.90.0050.00216.92
8.0.80.0100.00416.90
8.0.70.0040.00416.74
8.0.60.0000.00716.86
8.0.50.0030.00516.73
8.0.30.0120.00817.12
8.0.20.0150.00717.40
8.0.10.0070.00016.92
8.0.00.0120.01116.75
7.4.330.0000.00516.70
7.4.320.0030.00316.55
7.4.300.0050.00316.45
7.4.290.0000.00716.41
7.4.280.0050.00216.60
7.4.270.0000.00616.39
7.4.260.0070.00016.54
7.4.250.0050.00216.38
7.4.240.0040.00416.48
7.4.230.0070.00016.47
7.4.220.0090.00916.39
7.4.210.0100.00616.43
7.4.200.0040.00416.54
7.4.160.0160.00716.46
7.4.150.0090.00917.40
7.4.140.0070.01117.86
7.4.130.0130.00816.53
7.4.120.0100.00616.54
7.4.110.0120.00916.53
7.4.100.0200.00316.51
7.4.90.0060.01916.41
7.4.80.0130.01319.39
7.4.70.0140.00416.62
7.4.60.0070.01016.38
7.4.50.0060.01016.43
7.4.40.0100.00616.45
7.4.30.0110.01216.52
7.4.00.0060.01214.79
7.3.330.0040.00413.21
7.3.320.0050.00013.11
7.3.310.0070.00016.27
7.3.300.0070.00016.27
7.3.290.0000.00716.31
7.3.280.0070.01116.32
7.3.270.0090.00917.40
7.3.260.0080.00816.48
7.3.250.0080.00916.53
7.3.240.0050.01516.35
7.3.230.0070.01116.55
7.3.210.0170.00316.33
7.3.200.0060.00919.39
7.3.190.0140.00416.28
7.3.180.0070.01716.56
7.3.170.0090.00616.63
7.3.160.0030.01316.61
7.3.120.0070.01014.77
7.3.110.0050.01214.96
7.3.100.0060.00914.91
7.3.90.0030.00914.97
7.3.80.0060.00914.86
7.3.70.0060.00714.94
7.3.60.0030.00914.83
7.3.50.0070.00714.63
7.3.40.0030.01014.76
7.3.30.0090.00414.77
7.3.20.0050.00816.65
7.3.10.0030.00916.73
7.3.00.0000.01216.33
7.2.330.0070.01016.57
7.2.320.0100.01316.46
7.2.310.0100.00616.50
7.2.300.0070.01016.50
7.2.290.0050.01116.59
7.2.250.0060.00915.03
7.2.240.0040.01215.10
7.2.230.0030.01514.98
7.2.220.0020.01215.24
7.2.210.0030.00914.95
7.2.200.0030.00915.02
7.2.190.0060.00615.06
7.2.180.0030.01015.13
7.2.170.0060.00615.11
7.2.160.0130.00314.94
7.2.150.0000.01416.76
7.2.140.0030.01016.92
7.2.130.0040.00916.75
7.2.120.0060.00917.08
7.2.110.0040.00717.09
7.2.100.0150.00316.70
7.2.90.0060.00317.10
7.2.80.0060.01316.99
7.2.70.0140.00316.76
7.2.60.0070.00717.04
7.2.50.0000.01617.21
7.2.40.0000.01016.81
7.2.30.0090.00916.90
7.2.20.0090.00616.98
7.2.10.0100.00617.20
7.2.00.0070.00718.07
7.1.330.0070.00815.93
7.1.320.0020.01015.65
7.1.310.0030.00915.89
7.1.300.0030.01015.70
7.1.290.0000.01315.76
7.1.280.0060.00515.71
7.1.270.0020.01015.58
7.1.260.0030.01215.70
7.1.250.0040.00815.94
7.1.240.0060.00815.93
7.1.230.0030.00915.62
7.1.220.0030.00615.95
7.1.210.0050.00515.87
7.1.200.0080.00415.86
7.1.190.0050.00515.65
7.1.180.0040.01115.89
7.1.170.0070.00315.65
7.1.160.0070.00715.86
7.1.150.0040.00815.81
7.1.140.0060.01215.77
7.1.130.0150.00015.65
7.1.120.0070.00315.76
7.1.110.0000.01215.89
7.1.100.0030.01117.02
7.1.90.0000.01015.86
7.1.80.0050.00515.56
7.1.70.0040.00516.48
7.1.60.0050.01317.46
7.1.50.0090.01016.23
7.1.40.0040.01115.63
7.1.30.0030.01315.64
7.1.20.0000.01115.80
7.1.10.0030.01015.91
7.1.00.0050.04019.13
7.0.330.0070.01015.25
7.0.320.0100.00315.22
7.0.310.0030.01015.41
7.0.300.0140.00015.43
7.0.290.0040.01115.34
7.0.280.0000.01515.29
7.0.270.0060.00315.34
7.0.260.0090.00415.18
7.0.250.0000.01715.62
7.0.240.0070.00715.42
7.0.230.0070.00315.61
7.0.220.0040.00815.21
7.0.210.0060.00915.48
7.0.200.0280.00514.90
7.0.190.0110.00415.50
7.0.180.0060.00915.59
7.0.170.0090.00315.34
7.0.160.0000.01115.54
7.0.150.0100.00715.36
7.0.140.0120.00315.66
7.0.130.0000.01315.43
7.0.120.0000.01115.33
7.0.110.0060.00915.43
7.0.100.0090.00615.59
7.0.90.0100.01015.51
7.0.80.0040.00715.43
7.0.70.0040.00715.70
7.0.60.0160.04018.58
7.0.50.0020.04716.58
7.0.40.0050.02716.92
7.0.30.0200.02816.82
7.0.20.0200.03516.83
7.0.10.0020.03016.95
7.0.00.0030.04816.86
5.6.400.0100.00714.35
5.6.390.0000.01314.34
5.6.380.0040.01414.56
5.6.370.0070.00714.32
5.6.360.0060.00914.46
5.6.350.0080.00614.21
5.6.340.0060.01314.58
5.6.330.0100.00314.13
5.6.320.0070.00714.34
5.6.310.0090.00314.19
5.6.300.0130.00314.11
5.6.290.0060.00314.64
5.6.280.0060.02017.49
5.6.270.0090.00014.50
5.6.260.0080.00714.70
5.6.250.0100.00714.60
5.6.240.0030.01714.14
5.6.230.0000.01114.10
5.6.220.0100.00714.50
5.6.210.0050.02717.43
5.6.200.0030.03216.38
5.6.190.0120.04217.35
5.6.180.0200.03517.23
5.6.170.0170.03517.56
5.6.160.0100.04317.53
5.6.150.0050.04416.23
5.6.140.0070.03816.35
5.6.130.0030.03516.22
5.6.120.0060.02517.81
5.6.110.0100.04017.68
5.6.100.0030.03817.78
5.6.90.0140.04017.61
5.6.80.0050.04717.35
5.6.70.0140.00014.13
5.6.60.0000.01414.18
5.6.50.0060.00914.13
5.6.40.0030.01014.31
5.6.30.0070.00714.33
5.6.20.0030.00814.20
5.6.10.0080.00814.38
5.6.00.0030.00914.25
5.5.380.0000.01114.51
5.5.370.0100.00314.46
5.5.360.0090.00014.00
5.5.350.0070.02217.24
5.5.340.0070.03016.24
5.5.330.0050.04817.29
5.5.320.0160.03717.38
5.5.310.0190.03917.34
5.5.300.0090.04216.19
5.5.290.0030.05016.06
5.5.280.0030.03317.57
5.5.270.0060.04417.42
5.5.260.0070.04717.46
5.5.250.0070.02417.29
5.5.240.0100.02017.21
5.5.230.0000.01014.33
5.5.220.0100.00014.20
5.5.210.0070.00714.05
5.5.200.0080.00614.00
5.5.190.0090.00314.33
5.5.180.0060.00914.10
5.5.170.0000.01314.37
5.5.160.0060.00614.19
5.5.150.0000.00814.05
5.5.140.0070.00414.31
5.5.130.0070.00714.24
5.5.120.0000.01413.76
5.5.110.0060.00614.13
5.5.100.0120.00414.16
5.5.90.0030.01014.21
5.5.80.0120.00014.06
5.5.70.0130.00314.26
5.5.60.0040.00714.22
5.5.50.0070.00714.21
5.5.40.0110.00014.45
5.5.30.0030.01014.14
5.5.20.0000.01514.34
5.5.10.0030.00614.25
5.5.00.0030.00614.27

preferences:
41.16 ms | 401 KiB | 5 Q