3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { protected $val; public function __construct($val) { $this->$val = $val; } public function getVal() { return $this->val; } } $arr = array( 'one' => new test(10), 'two' => new test(1), 'three' => new test(5) ); $arr = uasort($arr, function (test $a, test $b) { if ($a->getVal() == $b->getVal()) { return 0; } return ($a->getVal() < $b->val()) ? -1 : 1; }); echo $arr;

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.01418.41
8.3.50.0150.01421.21
8.3.40.0120.00618.79
8.3.30.0070.00720.15
8.3.20.0030.00520.66
8.3.10.0050.00321.22
8.3.00.0040.00423.65
8.2.180.0060.00916.50
8.2.170.0120.00922.96
8.2.160.0100.00320.35
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0050.00321.13
8.2.110.0000.00822.31
8.2.100.0060.00617.97
8.2.90.0040.00419.35
8.2.80.0000.00819.21
8.2.70.0030.00617.50
8.2.60.0000.00818.03
8.2.50.0080.00018.07
8.2.40.0030.00619.88
8.2.30.0000.00719.36
8.2.20.0000.00717.73
8.2.10.0000.00817.67
8.2.00.0040.00417.81
8.1.280.0120.00325.92
8.1.270.0000.00823.99
8.1.260.0050.00326.35
8.1.250.0070.00028.09
8.1.240.0060.00322.54
8.1.230.0080.00320.98
8.1.220.0050.00318.77
8.1.210.0040.00418.99
8.1.200.0030.00617.35
8.1.190.0050.00317.53
8.1.180.0050.00318.10
8.1.170.0040.00418.71
8.1.160.0000.00818.77
8.1.150.0060.00318.55
8.1.140.0040.00417.50
8.1.130.0040.00417.71
8.1.120.0080.00017.50
8.1.110.0050.00317.37
8.1.100.0000.00817.43
8.1.90.0070.00017.38
8.1.80.0080.00017.35
8.1.70.0030.00317.39
8.1.60.0080.00017.63
8.1.50.0050.00317.45
8.1.40.0050.00317.53
8.1.30.0040.00417.49
8.1.20.0060.00317.71
8.1.10.0040.00417.48
8.1.00.0030.00617.51
8.0.300.0000.00819.98
8.0.290.0040.00417.04
8.0.280.0080.00018.46
8.0.270.0030.00317.13
8.0.260.0030.00316.93
8.0.250.0040.00417.05
8.0.240.0040.00416.99
8.0.230.0050.00317.00
8.0.220.0000.00716.97
8.0.210.0060.00016.96
8.0.200.0000.00616.96
8.0.190.0030.00416.94
8.0.180.0000.00817.02
8.0.170.0070.00016.91
8.0.160.0080.00017.03
8.0.150.0000.00716.95
8.0.140.0040.00416.84
8.0.130.0000.00513.36
8.0.120.0000.00716.94
8.0.110.0040.00416.85
8.0.100.0000.00716.94
8.0.90.0080.00017.09
8.0.80.0030.01416.91
8.0.70.0050.00217.02
8.0.60.0040.00416.82
8.0.50.0000.00717.00
8.0.30.0100.01017.32
8.0.20.0120.01017.40
8.0.10.0040.00417.06
8.0.00.0030.01616.83
7.4.330.0050.00016.71
7.4.320.0000.00616.53
7.4.300.0060.00016.58
7.4.290.0000.00616.52
7.4.280.0030.00716.53
7.4.270.0030.00316.43
7.4.260.0050.00013.25
7.4.250.0000.00716.56
7.4.240.0000.00716.64
7.4.230.0070.00016.39
7.4.220.0030.01616.68
7.4.210.0070.01016.57
7.4.200.0070.00016.49
7.4.190.0040.00416.55
7.4.160.0110.00616.55
7.4.150.0100.02417.40
7.4.140.0090.00817.86
7.4.130.0110.00716.67
7.4.120.0120.00816.67
7.4.110.0000.01716.67
7.4.100.0110.01116.50
7.4.90.0110.01216.47
7.4.80.0120.01319.39
7.4.70.0090.00916.65
7.4.60.0130.00316.41
7.4.50.0090.00016.56
7.4.40.0130.00322.77
7.4.30.0070.01016.51
7.4.00.0100.00314.98
7.3.330.0000.00513.20
7.3.320.0030.00313.31
7.3.310.0030.00316.21
7.3.300.0030.00316.37
7.3.290.0100.00416.50
7.3.280.0090.00716.38
7.3.270.0090.00917.40
7.3.260.0110.00918.24
7.3.250.0160.00416.49
7.3.240.0150.00016.38
7.3.230.0120.00916.66
7.3.210.0090.00916.37
7.3.200.0000.01719.39
7.3.190.0080.00816.45
7.3.180.0060.01216.38
7.3.170.0120.00616.52
7.3.160.0130.00316.66
7.3.120.0100.00314.87
7.2.330.0130.00316.83
7.2.320.0100.00716.86
7.2.310.0150.00616.86
7.2.300.0070.01316.82
7.2.290.0070.01616.81
7.2.00.0060.00619.58
7.1.100.0000.01417.96
7.1.70.0070.00716.97
7.1.60.0100.01619.17
7.1.50.0040.01117.14
7.1.00.0030.07722.55
7.0.200.0000.01416.68
7.0.140.0030.07322.13
7.0.60.0070.08719.87
7.0.50.0030.08317.89
7.0.40.0000.09320.20
7.0.30.0130.04320.24
7.0.20.0200.08020.20
7.0.10.0100.08020.22
7.0.00.0170.07720.10
5.6.280.0070.07021.12
5.6.210.0130.06320.57
5.6.200.0130.07018.14
5.6.190.0100.06320.45
5.6.180.0330.07720.64
5.6.170.0430.07320.62
5.6.160.0170.07720.50
5.6.150.0000.05018.25
5.6.140.0030.04718.28
5.6.130.0100.07018.26
5.6.120.0100.05321.11
5.6.110.0100.08720.99
5.6.100.0070.08320.96
5.6.90.0170.07321.04
5.6.80.0100.08020.40
5.6.70.4530.04020.50
5.5.350.0070.08020.39
5.5.340.0000.08318.02
5.5.330.0170.07020.28
5.5.320.0200.04720.34
5.5.310.0400.06320.30
5.5.300.0030.07717.94
5.5.290.0030.05317.95
5.5.280.0030.04720.89
5.5.270.0000.08320.77
5.5.260.0070.08320.77
5.5.250.0000.07720.58
5.5.240.0130.03320.05
5.4.450.0230.07319.41
5.4.440.0170.04719.42
5.4.430.0230.04719.55
5.4.420.0330.07019.27
5.4.410.0300.06319.28
5.4.400.0300.05319.09
5.4.390.0200.05019.17
5.4.380.0270.06019.16
5.4.370.0330.06719.23
5.4.360.0230.04319.22
5.4.350.0230.04019.14
5.4.340.0300.05319.31
5.4.320.0270.07018.84
5.4.310.0200.06319.21
5.4.300.0200.05019.14
5.4.290.0230.03719.22
5.4.280.0300.06719.30
5.4.270.0270.03319.14
5.4.260.0230.04018.86
5.4.250.0270.03319.23
5.4.240.0230.03718.86
5.4.230.0300.03018.99
5.4.220.0330.05719.12
5.4.210.0330.06319.11
5.4.200.0230.03318.98
5.4.190.0230.04318.86
5.4.180.0200.06318.96
5.4.170.0270.07019.18
5.4.160.0470.05318.84
5.4.150.0230.04019.29
5.4.140.0330.06316.42
5.4.130.0300.05016.34
5.4.120.0130.04016.51
5.4.110.0200.03716.19
5.4.100.0270.06716.50
5.4.90.0200.03716.40
5.4.80.0300.03716.24
5.4.70.0300.03716.39
5.4.60.0200.06316.54
5.4.50.0230.07016.54
5.4.40.0270.03316.51
5.4.30.0270.05716.51
5.4.20.0200.04016.43
5.4.10.0170.04016.42
5.4.00.0200.03715.84
5.3.290.0170.04014.72
5.3.280.0200.04714.59
5.3.270.0270.06714.84
5.3.260.0300.07014.52
5.3.250.0200.07314.66
5.3.240.0330.06714.69
5.3.230.0300.06714.51
5.3.220.0200.04014.80
5.3.210.0330.03314.48
5.3.200.0230.05014.69
5.3.190.0370.06714.69
5.3.180.0330.03314.58
5.3.170.0270.03014.47
5.3.160.0270.06014.47
5.3.150.0270.03714.49
5.3.140.0300.05014.79
5.3.130.0230.03714.67
5.3.120.0230.03714.46
5.3.110.0270.06014.56
5.3.100.0230.03714.02
5.3.90.0230.03714.00
5.3.80.0170.04014.18
5.3.70.0170.04014.14
5.3.60.0300.06713.91
5.3.50.0270.07014.04
5.3.40.0230.07714.07
5.3.30.0230.03313.93
5.3.20.0230.06013.71
5.3.10.0230.07013.59
5.3.00.0200.05013.56
5.2.170.0300.03712.09
5.2.160.0230.05712.09
5.2.150.0170.06312.09
5.2.140.0230.03012.09
5.2.130.0130.03012.09
5.2.120.0100.03312.09
5.2.110.0130.03012.09
5.2.100.0200.02312.09
5.2.90.0170.02712.09
5.2.80.0200.02312.09
5.2.70.0130.03712.09
5.2.60.0100.03312.09
5.2.50.0200.02712.09
5.2.40.0100.03012.09
5.2.30.0100.04012.09
5.2.20.0070.03312.09
5.2.10.0170.02712.09
5.2.00.0130.02712.09
5.1.60.0030.03012.09
5.1.50.0070.02712.09
5.1.40.0170.02012.09
5.1.30.0100.03012.09
5.1.20.0100.02712.09
5.1.10.0130.03012.09
5.1.00.0170.02012.09
5.0.50.0100.01712.09
5.0.40.0070.02012.09
5.0.30.0030.03312.09
5.0.20.0070.02312.09
5.0.10.0130.01312.09
5.0.00.0070.03712.09
4.4.90.0030.01712.09
4.4.80.0030.01712.09
4.4.70.0070.01312.09
4.4.60.0100.01012.09
4.4.50.0070.01312.09
4.4.40.0100.02012.09
4.4.30.0070.02012.09
4.4.20.0100.01012.09
4.4.10.0070.01312.09
4.4.00.0030.02712.09
4.3.110.0030.01712.09
4.3.100.0070.01312.09
4.3.90.0070.01312.09
4.3.80.0070.02312.09
4.3.70.0070.01312.09
4.3.60.0070.01312.09
4.3.50.0070.02012.09
4.3.40.0070.02312.09
4.3.30.0000.01712.09
4.3.20.0070.01312.09
4.3.10.0000.01712.09
4.3.00.0000.01312.09

preferences:
49.33 ms | 401 KiB | 5 Q