3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); class Foo { private $x; public function setX($x) : Foo { $this->x = $x; return $this; } public function getX() { return $this->x; } } function test($class) { if (class_exists($class)) { return new $class(); } return null; } $x = test('Fo')->setX('test'); var_dump($x->getX());

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.00416.75
8.3.50.0110.00717.84
8.3.40.0030.01418.79
8.3.30.0110.00418.54
8.3.20.0040.00420.21
8.3.10.0030.00523.63
8.3.00.0040.00419.79
8.2.180.0090.00916.35
8.2.170.0040.01122.96
8.2.160.0040.00920.47
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0090.00021.18
8.2.120.0040.00426.35
8.2.110.0030.00620.39
8.2.100.0080.00418.04
8.2.90.0030.00519.14
8.2.80.0030.00617.97
8.2.70.0000.00817.63
8.2.60.0000.00917.93
8.2.50.0000.00818.07
8.2.40.0000.00921.13
8.2.30.0000.00720.50
8.2.20.0040.00417.69
8.2.10.0080.00017.91
8.2.00.0040.00417.87
8.1.280.0080.00825.92
8.1.270.0050.00320.38
8.1.260.0040.00428.09
8.1.250.0000.00728.09
8.1.240.0000.00823.97
8.1.230.0090.00317.72
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0030.00617.13
8.1.190.0040.00416.98
8.1.180.0040.00418.10
8.1.170.0040.00418.51
8.1.160.0040.00420.64
8.1.150.0000.00718.68
8.1.140.0050.00319.44
8.1.130.0070.00017.57
8.1.120.0030.00517.33
8.1.110.0070.00017.35
8.1.100.0060.00317.38
8.1.90.0040.00417.19
8.1.80.0030.00517.29
8.1.70.0040.00417.22
8.1.60.0000.00817.40
8.1.50.0050.00317.39
8.1.40.0040.00417.38
8.1.30.0080.00417.59
8.1.20.0000.00717.56
8.1.10.0040.00417.40
8.1.00.0040.00417.46
8.0.300.0000.00818.77
8.0.290.0050.00216.75
8.0.280.0030.00318.38
8.0.270.0000.00717.06
8.0.260.0000.00717.07
8.0.250.0040.00416.92
8.0.240.0030.00316.82
8.0.230.0040.00416.93
8.0.220.0030.00316.79
8.0.210.0030.00316.86
8.0.200.0000.00616.93
8.0.190.0040.00417.00
8.0.180.0000.00716.92
8.0.170.0040.00416.84
8.0.160.0000.00816.96
8.0.150.0040.00416.73
8.0.140.0030.00616.70
8.0.130.0040.00413.28
8.0.120.0000.00816.88
8.0.110.0040.00416.90
8.0.100.0030.00316.80
8.0.90.0000.00816.88
8.0.80.0090.00616.92
8.0.70.0000.00716.89
8.0.60.0000.00716.89
8.0.50.0070.00016.89
8.0.30.0120.00817.05
8.0.20.0090.01317.40
8.0.10.0000.00716.91
8.0.00.0080.01016.80
7.4.330.0000.00616.84
7.4.320.0000.00716.46
7.4.300.0050.00216.52
7.4.290.0040.00716.30
7.4.280.0040.00416.53
7.4.270.0000.00716.36
7.4.260.0000.00716.44
7.4.250.0040.00416.36
7.4.240.0030.00316.44
7.4.230.0000.00716.43
7.4.220.0040.01416.61
7.4.210.0120.00316.58
7.4.200.0030.00316.51
7.4.160.0140.00916.53
7.4.150.0060.01217.40
7.4.140.0130.00517.86
7.4.130.0170.00716.45
7.4.120.0170.00516.34
7.4.110.0140.00316.72
7.4.100.0140.00416.21
7.4.90.0130.00316.52
7.4.80.0090.01219.39
7.4.70.0140.00716.56
7.4.60.0060.01016.62
7.4.50.0060.00916.35
7.4.40.0130.00316.36
7.4.30.0100.01016.35
7.4.00.0080.00815.05
7.3.330.0060.00013.31
7.3.320.0000.00513.26
7.3.310.0030.00316.30
7.3.300.0000.00716.30
7.3.290.0110.00816.28
7.3.280.0100.00616.30
7.3.270.0090.00917.40
7.3.260.0040.01216.23
7.3.240.0070.01016.52
7.3.230.0100.00716.39
7.3.210.0140.00716.43
7.3.200.0110.00716.20
7.3.190.0090.00916.33
7.3.180.0040.01816.27
7.3.170.0190.00416.42
7.3.160.0060.00916.51
7.2.330.0100.00716.46
7.2.320.0100.00716.64
7.2.310.0100.00716.24
7.2.300.0110.00616.49
7.2.290.0180.00316.52
7.2.60.0070.00716.60
7.2.00.0060.00619.32
7.1.200.0000.01415.68
7.1.100.0060.00318.27
7.1.70.0000.00817.00
7.1.60.0060.00919.13
7.1.50.0030.00716.83
7.1.00.0070.07022.40
7.0.200.0160.00315.02
7.0.60.0100.07319.95
7.0.50.0000.04717.85
7.0.40.0000.05720.13
7.0.30.0370.07320.28
7.0.20.0300.07720.05
7.0.10.0070.06320.06
7.0.00.0030.04320.25
5.6.280.0030.06721.12
5.6.210.0130.07020.53
5.6.200.0030.08018.29
5.6.190.0100.04020.61
5.6.180.0300.07320.63
5.6.170.0200.07020.56
5.6.160.0100.03720.47
5.6.150.0100.07718.27
5.6.140.0130.07718.15
5.6.130.0070.08018.27
5.6.120.0100.08021.10
5.6.110.0030.04720.98
5.6.100.0130.04321.01
5.6.90.0170.07320.97
5.6.80.0170.07320.41
5.5.350.0100.08320.45
5.5.340.0070.05317.98
5.5.330.0130.07720.38
5.5.320.0700.06320.42
5.5.310.0230.07720.34
5.5.300.0030.05317.97
5.5.290.0030.05017.95
5.5.280.0070.04020.87
5.5.270.0070.04320.87
5.5.260.0100.08320.87
5.5.250.0200.07020.50
5.5.240.0070.04720.07

preferences:
43.85 ms | 401 KiB | 5 Q