3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function spam(array $values) { usort($values, [$this, 'sort']); return $values; } // Protected, expected to not work. But does?! protected function sort($a, $b) { return -1; } } $a = array( 3, 4, 1, 2, ); $foo = new Foo(); var_dump($foo->spam($a));

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.0180.00316.50
8.3.50.0150.00521.99
8.3.40.0070.00718.67
8.3.30.0040.01118.64
8.3.20.0000.00720.27
8.3.10.0060.00323.65
8.3.00.0040.00419.25
8.2.180.0100.01018.17
8.2.170.0110.00422.96
8.2.160.0070.01022.09
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00017.34
8.2.120.0110.00026.35
8.2.110.0060.00322.15
8.2.100.0080.00417.80
8.2.90.0050.00319.23
8.2.80.0040.00417.97
8.2.70.0000.00817.38
8.2.60.0000.00917.91
8.2.50.0040.00418.07
8.2.40.0090.00019.34
8.2.30.0070.00020.68
8.2.20.0030.00617.67
8.2.10.0040.00418.02
8.2.00.0080.00018.02
8.1.280.0100.00725.92
8.1.270.0060.00322.06
8.1.260.0000.00728.09
8.1.250.0020.00528.09
8.1.240.0070.00322.53
8.1.230.0120.00019.31
8.1.220.0060.00617.74
8.1.210.0040.00418.77
8.1.200.0080.00317.47
8.1.190.0080.00017.22
8.1.180.0040.00418.10
8.1.170.0070.00018.71
8.1.160.0000.00721.89
8.1.150.0070.00018.83
8.1.140.0040.00419.69
8.1.130.0030.00317.71
8.1.120.0040.00417.36
8.1.110.0030.00617.41
8.1.100.0050.00217.52
8.1.90.0040.00417.51
8.1.80.0050.00317.46
8.1.70.0030.00317.39
8.1.60.0080.00017.57
8.1.50.0040.00417.54
8.1.40.0000.00817.42
8.1.30.0040.00417.63
8.1.20.0040.00417.62
8.1.10.0000.00817.62
8.1.00.0000.00917.40
8.0.300.0060.00318.77
8.0.290.0040.00416.75
8.0.280.0030.00318.46
8.0.270.0030.00316.78
8.0.260.0000.00717.27
8.0.250.0070.00016.99
8.0.240.0080.00016.90
8.0.230.0030.00316.82
8.0.220.0030.00316.96
8.0.210.0060.00316.79
8.0.200.0030.00316.95
8.0.190.0090.00016.97
8.0.180.0000.00716.83
8.0.170.0000.00816.79
8.0.160.0000.00716.86
8.0.150.0000.00716.80
8.0.140.0040.00816.82
8.0.130.0000.00613.40
8.0.120.0040.00416.75
8.0.110.0070.00016.90
8.0.100.0070.00016.80
8.0.90.0070.00016.88
8.0.80.0060.00916.88
8.0.70.0080.00016.83
8.0.60.0050.00216.93
8.0.50.0070.00016.89
8.0.30.0070.00917.20
8.0.20.0150.00417.40
8.0.10.0000.00716.91
8.0.00.0110.00716.71
7.4.330.0030.00315.11
7.4.320.0060.00016.52
7.4.300.0040.00416.61
7.4.290.0000.00716.57
7.4.280.0080.00016.63
7.4.270.0000.00716.50
7.4.260.0000.00816.61
7.4.250.0000.00716.49
7.4.240.0020.00516.61
7.4.230.0000.00616.61
7.4.220.0100.01016.71
7.4.210.0090.00616.55
7.4.200.0000.00716.69
7.4.160.0120.00416.42
7.4.150.0040.01417.40
7.4.140.0140.01317.86
7.4.130.0090.01216.62
7.4.120.0130.00416.49
7.4.110.0090.00916.32
7.4.100.0130.00716.56
7.4.90.0160.00416.52
7.4.80.0030.01419.39
7.4.70.0090.01216.64
7.4.60.0130.00316.42
7.4.50.0040.01116.25
7.4.40.0120.00616.59
7.4.30.0130.01316.63
7.4.00.0100.00315.13
7.3.330.0000.00513.29
7.3.320.0060.00013.32
7.3.310.0050.00216.27
7.3.300.0070.00016.35
7.3.290.0120.00416.27
7.3.280.0100.00616.29
7.3.270.0120.00417.40
7.3.260.0120.00616.32
7.3.250.0110.00816.37
7.3.240.0120.00716.19
7.3.230.0070.01016.39
7.3.210.0110.01116.26
7.3.200.0140.00316.50
7.3.190.0060.01116.35
7.3.180.0040.01316.59
7.3.170.0060.01616.43
7.3.160.0090.00616.36
7.3.10.0030.01016.49
7.3.00.0080.00516.70
7.2.330.0110.00616.33
7.2.320.0150.00416.31
7.2.310.0070.01116.54
7.2.300.0080.00816.60
7.2.290.0110.00616.63
7.2.130.0070.01017.01
7.2.120.0100.00716.79
7.2.110.0030.00616.90
7.2.100.0070.01017.04
7.2.90.0040.01416.95
7.2.80.0030.00716.70
7.2.70.0090.00616.85
7.2.60.0070.00716.89
7.2.50.0000.01416.79
7.2.40.0040.00816.66
7.2.30.0080.00316.95
7.2.20.0090.00616.90
7.2.10.0100.00717.10
7.2.00.0070.00316.69
7.1.250.0090.00015.75
7.1.200.0050.00515.83
7.1.70.0030.01417.14
7.1.60.0130.01019.48
7.1.50.0070.01416.94
7.1.00.0030.07722.45
7.0.200.0300.01314.44
7.0.60.0200.07019.94
7.0.50.0030.08317.86
7.0.40.0100.08020.25
7.0.30.0170.05720.25
7.0.20.0270.06720.11
7.0.10.0070.04020.06
7.0.00.0070.06020.27
5.6.280.0030.03320.93
5.6.210.0070.07320.70
5.6.200.0100.08318.19
5.6.190.0030.06020.52
5.6.180.0070.05320.47
5.6.170.0300.07720.44
5.6.160.0130.03320.39
5.6.150.0130.07718.19
5.6.140.0100.05718.13
5.6.130.0030.08018.14
5.6.120.0070.09021.05
5.6.110.0200.06720.98
5.6.100.0000.04721.01
5.6.90.0070.07721.13
5.6.80.0100.06020.38
5.5.350.4330.03720.39
5.5.340.0000.04018.09
5.5.330.0100.07320.37
5.5.320.0530.06720.53
5.5.310.0200.05720.50
5.5.300.0100.05017.95
5.5.290.0100.07018.00
5.5.280.0070.07720.73
5.5.270.0030.04020.96
5.5.260.0100.05320.65
5.5.250.0230.06720.80
5.5.240.0030.07720.34

preferences:
51.75 ms | 401 KiB | 5 Q