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(53), 'two' => new test(200), 'three' => new test(100) ); uasort($arr, function (test $a, test $b) { if ($a->getVal() == $b->getVal()) { return 0; } return ($a->getVal() < $b->val()) ? -1 : 1; }); print_r($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.0100.01018.68
8.3.50.0120.01021.13
8.3.40.0140.00418.84
8.3.30.0070.00720.20
8.3.20.0040.00420.70
8.3.10.0060.00321.27
8.3.00.0040.00423.62
8.2.180.0090.01216.50
8.2.170.0070.01422.96
8.2.160.0070.00720.35
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0040.00419.36
8.2.110.0090.00022.26
8.2.100.0060.00617.84
8.2.90.0040.00419.21
8.2.80.0000.00719.20
8.2.70.0000.00917.75
8.2.60.0030.00517.93
8.2.50.0040.00418.07
8.2.40.0090.00019.84
8.2.30.0050.00219.38
8.2.20.0040.00417.66
8.2.10.0000.00817.65
8.2.00.0000.00817.72
8.1.280.0110.00725.92
8.1.270.0030.00623.99
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0030.00622.59
8.1.230.0040.00720.98
8.1.220.0040.00418.77
8.1.210.0000.00818.89
8.1.200.0030.00617.48
8.1.190.0080.00017.41
8.1.180.0000.00818.10
8.1.170.0080.00018.56
8.1.160.0040.00418.83
8.1.150.0060.00318.62
8.1.140.0040.00417.38
8.1.130.0030.00317.91
8.1.120.0050.00317.52
8.1.110.0070.00017.40
8.1.100.0040.00417.36
8.1.90.0080.00017.38
8.1.80.0040.00417.52
8.1.70.0050.00317.44
8.1.60.0050.00517.66
8.1.50.0000.00817.48
8.1.40.0040.00417.41
8.1.30.0030.00617.59
8.1.20.0000.00817.68
8.1.10.0080.00017.46
8.1.00.0090.00017.60
8.0.300.0030.00620.02
8.0.290.0070.00017.16
8.0.280.0030.00318.44
8.0.270.0030.00317.15
8.0.260.0070.00016.89
8.0.250.0040.00417.00
8.0.240.0040.00416.92
8.0.230.0050.00217.04
8.0.220.0030.00316.87
8.0.210.0040.00416.99
8.0.200.0030.00317.00
8.0.190.0040.00417.04
8.0.180.0030.00516.82
8.0.170.0000.00716.87
8.0.160.0030.00616.88
8.0.150.0070.00016.97
8.0.140.0000.00816.79
8.0.130.0030.00313.30
8.0.120.0040.00416.84
8.0.110.0030.00416.98
8.0.100.0000.00716.95
8.0.90.0040.00416.94
8.0.80.0040.01316.87
8.0.70.0000.00816.96
8.0.60.0040.00416.83
8.0.50.0030.00517.01
8.0.30.0130.00917.02
8.0.20.0090.00817.40
8.0.10.0050.00217.06
8.0.00.0070.01616.79
7.4.330.0050.00016.84
7.4.320.0060.00016.64
7.4.300.0000.00616.61
7.4.290.0030.00316.51
7.4.280.0000.00916.41
7.4.270.0030.00316.42
7.4.260.0000.00613.27
7.4.250.0040.00416.49
7.4.240.0050.00316.53
7.4.230.0030.00316.41
7.4.220.0130.01016.69
7.4.210.0070.01116.53
7.4.200.0000.00716.54
7.4.190.0030.00516.73
7.4.160.0100.00616.70
7.4.150.0100.01217.40
7.4.140.0100.00717.86
7.4.130.0080.01316.64
7.4.120.0140.00316.51
7.4.110.0120.00616.46
7.4.100.0150.00316.29
7.4.90.0130.00316.41
7.4.80.0070.01119.39
7.4.70.0160.00016.61
7.4.60.0160.00016.55
7.4.50.0000.00616.61
7.4.40.0110.00722.77
7.4.30.0070.01016.59
7.4.00.0030.00915.17
7.3.330.0000.00613.34
7.3.320.0000.00513.44
7.3.310.0000.00716.38
7.3.300.0000.00716.38
7.3.290.0080.01016.35
7.3.280.0080.01016.31
7.3.270.0030.01517.40
7.3.260.0100.01018.24
7.3.250.0140.00616.29
7.3.240.0130.00316.71
7.3.230.0120.00416.39
7.3.210.0000.01716.55
7.3.200.0090.01819.39
7.3.190.0030.01816.14
7.3.180.0130.00316.62
7.3.170.0070.01016.41
7.3.160.0060.00916.63
7.3.120.0070.00715.11
7.2.330.0100.00616.89
7.2.320.0120.00616.43
7.2.310.0030.01816.75
7.2.300.0160.00016.80
7.2.290.0150.00316.65
7.2.60.0080.00317.03
7.2.00.0030.01019.46
7.1.200.0040.01115.89
7.1.100.0110.00718.19
7.1.70.0030.00717.03
7.1.60.0070.01819.17
7.1.50.0030.01316.99
7.1.00.0070.05022.51
7.0.200.0040.01116.75
7.0.140.0030.07322.01
7.0.60.0130.08319.87
7.0.50.0130.07017.87
7.0.40.0100.05020.18
7.0.30.0500.07720.39
7.0.20.0300.08020.30
7.0.10.0370.07720.20
7.0.00.0070.05020.14
5.6.280.0000.07721.13
5.6.210.0000.04020.75
5.6.200.0070.04018.29
5.6.190.0030.04720.43
5.6.180.0270.04720.48
5.6.170.0270.03720.52
5.6.160.0030.04720.54
5.6.150.0070.04018.19
5.6.140.0070.07718.17
5.6.130.0030.04318.15
5.6.120.0100.04721.02
5.6.110.0030.07321.02
5.6.100.0070.04721.00
5.6.90.0000.09021.11
5.6.80.0100.06720.53
5.6.70.3070.03020.50
5.5.350.0300.07720.36
5.5.340.0100.06717.99
5.5.330.0070.09020.13
5.5.320.0300.07720.28
5.5.310.0300.04320.31
5.5.300.0030.04017.98
5.5.290.0030.05017.95
5.5.280.0000.04320.86
5.5.270.0100.05720.85
5.5.260.0170.05720.88
5.5.250.0030.08320.70
5.5.240.0000.04320.29
5.4.450.0230.04019.32
5.4.440.0300.07019.30
5.4.430.0230.03719.63
5.4.420.0270.05019.38
5.4.410.0230.05319.34
5.4.400.0230.05319.06
5.4.390.0230.07318.98
5.4.380.0230.03719.07
5.4.370.0230.04719.21
5.4.360.0230.05019.21
5.4.350.0300.06719.09
5.4.340.0270.07318.98
5.4.320.0270.07019.16
5.4.310.0130.04318.99
5.4.300.0300.07019.16
5.4.290.0330.06318.98
5.4.280.0370.05719.15
5.4.270.0370.05319.14
5.4.260.0370.05719.30
5.4.250.0270.03719.30
5.4.240.0270.06719.24
5.4.230.0230.05718.82
5.4.220.0300.05319.13
5.4.210.0230.05019.23
5.4.200.0330.06719.01
5.4.190.0130.05019.12
5.4.180.0230.04319.30
5.4.170.0130.04719.04
5.4.160.0300.07019.06
5.4.150.0370.04719.29
5.4.140.0300.03016.33
5.4.130.0270.04316.31
5.4.120.0300.06716.50
5.4.110.0300.04016.40
5.4.100.0200.03716.45
5.4.90.0270.05016.21
5.4.80.0200.03316.26
5.4.70.0200.03316.52
5.4.60.0200.04316.25
5.4.50.0200.03316.48
5.4.40.0130.04016.55
5.4.30.0200.03316.52
5.4.20.0230.04016.42
5.4.10.0200.03716.33
5.4.00.0230.03015.96
5.3.290.0130.05014.89
5.3.280.0300.06714.50
5.3.270.0170.04314.84
5.3.260.0270.05314.53
5.3.250.0330.03314.52
5.3.240.0330.05014.51
5.3.230.0370.05714.50
5.3.220.0170.04314.48
5.3.210.0270.05314.49
5.3.200.0200.03714.65
5.3.190.0230.03314.69
5.3.180.0130.04014.79
5.3.170.0200.03714.57
5.3.160.0200.04314.56
5.3.150.0200.03314.50
5.3.140.0130.04314.53
5.3.130.0200.06014.52
5.3.120.0170.05314.53
5.3.110.0200.03714.45
5.3.100.0200.03314.28
5.3.90.0130.04013.92
5.3.80.0270.07013.92
5.3.70.0230.06313.93
5.3.60.0270.04713.92
5.3.50.0200.04714.07
5.3.40.0200.05014.07
5.3.30.0230.06314.00
5.3.20.0300.03313.61
5.3.10.0270.06013.75
5.3.00.0200.04013.62
5.2.170.0230.05711.25
5.2.160.0230.04011.25
5.2.150.0170.03711.25
5.2.140.0230.04711.25
5.2.130.0200.02711.25
5.2.120.0200.06011.25
5.2.110.0170.03711.25
5.2.100.0170.03011.25
5.2.90.0170.04011.25
5.2.80.0200.03711.25
5.2.70.0170.04011.25
5.2.60.0230.02311.25
5.2.50.0230.03711.25
5.2.40.0200.03311.25
5.2.30.0200.02711.25
5.2.20.0170.05711.25
5.2.10.0200.04011.25
5.2.00.0200.02311.25
5.1.60.0200.02711.25
5.1.50.0200.02311.25
5.1.40.0200.04311.25
5.1.30.0200.03311.25
5.1.20.0130.03011.25
5.1.10.0170.05011.25
5.1.00.0170.03311.25
5.0.50.0100.02011.25
5.0.40.0070.04711.25
5.0.30.0130.04711.25
5.0.20.0170.03011.25
5.0.10.0130.04311.25
5.0.00.0130.06011.25
4.4.90.0070.01711.25
4.4.80.0130.01711.25
4.4.70.0100.01311.25
4.4.60.0170.00711.25
4.4.50.0070.02011.25
4.4.40.0070.02311.25
4.4.30.0100.02011.25
4.4.20.0070.01711.25
4.4.10.0130.03011.25
4.4.00.0070.05311.25
4.3.110.0130.03011.25
4.3.100.0130.03311.25
4.3.90.0070.03311.25
4.3.80.0070.03711.25
4.3.70.0100.03311.25
4.3.60.0070.03711.25
4.3.50.0070.03011.25
4.3.40.0100.03011.25
4.3.30.0070.03711.25
4.3.20.0070.03311.25
4.3.10.0070.03011.25
4.3.00.0070.02711.25

preferences:
39.57 ms | 401 KiB | 5 Q