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); var_dump($x); var_dump($x == 'foo-test' || $x == '-' || $x == 'bar-test'); if (!isset($this->a[$x])) { throw new Exception('Missing X: "' . $x . '"'); } if (!isset($this->a[$y])) { throw new Exception('Missing Y: "' . $y . '"'); } return ($x < $y ? -1 : ($x > $y ? 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.01216.63
8.3.50.0120.00721.04
8.3.40.0040.01518.59
8.3.30.0120.00318.51
8.3.20.0000.00720.35
8.3.10.0050.00323.63
8.3.00.0040.00421.85
8.2.180.0120.00318.29
8.2.170.0040.01622.96
8.2.160.0070.00720.38
8.2.150.0050.00324.18
8.2.140.0000.00724.66
8.2.130.0040.00421.00
8.2.120.0080.00026.35
8.2.110.0070.00322.24
8.2.100.0070.00417.91
8.2.90.0000.00819.26
8.2.80.0050.00317.97
8.2.70.0060.00317.63
8.2.60.0060.00318.05
8.2.50.0110.00018.09
8.2.40.0090.00022.18
8.2.30.0080.00019.58
8.2.20.0080.00017.68
8.2.10.0000.00818.05
8.2.00.0000.00818.13
8.1.280.0110.00325.92
8.1.270.0100.01022.20
8.1.260.0050.00228.09
8.1.250.0020.00528.09
8.1.240.0090.00321.86
8.1.230.0050.00520.73
8.1.220.0040.00417.76
8.1.210.0030.00518.77
8.1.200.0030.00617.10
8.1.190.0060.00317.25
8.1.180.0000.00818.10
8.1.170.0100.00018.67
8.1.160.0040.00420.72
8.1.150.0000.00718.90
8.1.140.0040.00419.59
8.1.130.0000.00717.71
8.1.120.0050.00317.44
8.1.110.0040.00417.42
8.1.100.0000.00717.31
8.1.90.0040.00417.36
8.1.80.0040.00417.30
8.1.70.0000.00717.32
8.1.60.0040.00417.43
8.1.50.0040.00417.47
8.1.40.0030.00717.38
8.1.30.0000.00817.50
8.1.20.0000.00817.51
8.1.10.0070.00017.51
8.1.00.0030.00517.47
8.0.300.0080.00018.77
8.0.290.0070.00016.75
8.0.280.0000.00818.37
8.0.270.0040.00417.16
8.0.260.0000.00617.30
8.0.250.0050.00317.03
8.0.240.0030.00516.95
8.0.230.0000.00916.86
8.0.220.0000.00716.86
8.0.210.0070.00016.81
8.0.200.0000.00616.86
8.0.190.0000.00716.79
8.0.180.0040.00416.76
8.0.170.0050.00316.93
8.0.160.0000.00716.83
8.0.150.0030.00316.66
8.0.140.0070.00016.81
8.0.130.0050.00013.34
8.0.120.0000.00816.78
8.0.110.0040.00416.86
8.0.100.0000.00716.84
8.0.90.0040.00416.70
8.0.80.0060.00916.78
8.0.70.0000.00816.75
8.0.60.0050.00316.73
8.0.50.0080.00016.66
8.0.30.0080.00917.07
8.0.20.0080.01117.40
8.0.10.0000.00716.84
8.0.00.0080.01316.71
7.4.330.0000.00516.77
7.4.320.0060.00016.46
7.4.300.0000.00716.54
7.4.290.0070.00016.54
7.4.280.0040.00416.44
7.4.270.0040.00416.56
7.4.260.0070.00016.54
7.4.250.0080.00016.50
7.4.240.0000.00716.54
7.4.230.0070.00016.29
7.4.220.0060.01216.48
7.4.210.0100.00816.50
7.4.200.0000.00716.36
7.4.160.0090.00916.61
7.4.150.0140.00717.40
7.4.140.0120.01117.86
7.4.130.0100.00916.51
7.4.120.0100.01016.55
7.4.110.0040.01416.65
7.4.100.0060.01216.51
7.4.90.0190.00316.41
7.4.80.0100.01319.39
7.4.70.0110.00516.49
7.4.60.0090.00616.59
7.4.50.0070.01116.44
7.4.40.0060.01216.63
7.4.30.0140.00516.42
7.4.00.0030.01514.69
7.3.330.0030.00313.09
7.3.320.0030.00313.31
7.3.310.0030.00516.32
7.3.300.0030.00316.26
7.3.290.0030.00316.26
7.3.280.0100.00816.29
7.3.270.0090.00917.40
7.3.260.0170.00316.43
7.3.250.0080.01016.42
7.3.240.0130.00416.59
7.3.230.0070.01016.39
7.3.210.0060.01216.28
7.3.200.0070.01319.39
7.3.190.0090.00616.40
7.3.180.0080.00816.51
7.3.170.0080.01216.38
7.3.160.0110.00416.48
7.3.10.0040.01116.65
7.3.00.0060.00616.52
7.2.330.0140.00316.79
7.2.320.0090.00916.57
7.2.310.0030.01316.79
7.2.300.0120.00916.91
7.2.290.0030.01316.64
7.2.130.0150.00016.96
7.2.120.0040.01116.98
7.2.110.0070.00716.97
7.2.100.0030.00917.06
7.2.90.0000.01216.88
7.2.80.0060.00317.07
7.2.70.0030.01316.85
7.2.60.0070.00716.77
7.2.50.0100.00316.81
7.2.40.0000.00817.10
7.2.30.0040.00716.71
7.2.20.0080.00417.06
7.2.10.0000.01116.96
7.2.00.0050.00818.26
7.1.250.0030.00615.76
7.1.200.0000.01515.83
7.1.100.0300.00012.03
7.1.70.0070.00716.90
7.1.60.0130.01319.40
7.1.50.0120.00317.00
7.1.00.0030.07722.33
7.0.200.0560.00714.47
7.0.60.0300.03319.94
7.0.50.0100.04017.90
7.0.40.0070.06720.27
7.0.30.0270.05320.23
7.0.20.0330.05320.07
7.0.10.0030.04720.26
7.0.00.0100.05320.21
5.6.280.0000.06321.04
5.6.210.0070.05020.67
5.6.200.0070.04718.22
5.6.190.0130.08020.56
5.6.180.0230.08020.41
5.6.170.0330.07720.48
5.6.160.0130.06720.63
5.6.150.0100.05318.18
5.6.140.0100.07318.17
5.6.130.0030.04018.14
5.6.120.0000.04321.16
5.6.110.0030.06721.00
5.6.100.0000.04321.02
5.6.90.0070.06321.00
5.6.80.0070.08020.41
5.5.350.0000.03320.45
5.5.340.0030.08717.98
5.5.330.0030.05020.27
5.5.320.0600.07020.52
5.5.310.0270.07320.26
5.5.300.0070.08017.98
5.5.290.0070.04018.01
5.5.280.0070.04320.66
5.5.270.0100.04020.88
5.5.260.0070.08020.80
5.5.250.0030.04320.70
5.5.240.0130.04320.05

preferences:
55.9 ms | 401 KiB | 5 Q