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) { $obj = new $class(); if (is_object($obj)) { return $obj; } return null; } $x = test('Foo')->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.0070.01116.50
8.3.50.0130.00622.18
8.3.40.0170.00018.88
8.3.30.0070.00718.79
8.3.20.0040.00420.20
8.3.10.0070.00023.66
8.3.00.0000.00819.79
8.2.180.0070.01118.12
8.2.170.0130.00622.96
8.2.160.0110.00320.36
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0030.00621.04
8.2.120.0070.00326.35
8.2.110.0100.00720.11
8.2.100.0030.00717.80
8.2.90.0030.00519.17
8.2.80.0050.00317.97
8.2.70.0060.00317.61
8.2.60.0000.01117.93
8.2.50.0000.00918.07
8.2.40.0060.00321.01
8.2.30.0040.00420.66
8.2.20.0040.00417.56
8.2.10.0040.00417.88
8.2.00.0040.00417.87
8.1.280.0170.00325.92
8.1.270.0060.00320.24
8.1.260.0000.00728.09
8.1.250.0040.00428.09
8.1.240.0090.00022.14
8.1.230.0000.01117.58
8.1.220.0090.00017.74
8.1.210.0050.00318.77
8.1.200.0030.00617.36
8.1.190.0000.00817.00
8.1.180.0040.00418.10
8.1.170.0050.00318.51
8.1.160.0000.00720.73
8.1.150.0050.00318.82
8.1.140.0040.00419.44
8.1.130.0040.00417.68
8.1.120.0000.00717.45
8.1.110.0000.00717.36
8.1.100.0080.00017.41
8.1.90.0040.00417.43
8.1.80.0050.00317.32
8.1.70.0000.00717.42
8.1.60.0060.00317.54
8.1.50.0000.00917.55
8.1.40.0060.00317.52
8.1.30.0060.00617.57
8.1.20.0080.00017.63
8.1.10.0000.00717.61
8.1.00.0000.00717.40
8.0.300.0040.00418.77
8.0.290.0000.00716.63
8.0.280.0030.00318.35
8.0.270.0030.00317.12
8.0.260.0030.00317.20
8.0.250.0030.00316.83
8.0.240.0000.00716.90
8.0.230.0030.00616.90
8.0.220.0000.00816.78
8.0.210.0030.00316.81
8.0.200.0000.00616.82
8.0.190.0030.00616.95
8.0.180.0040.00416.88
8.0.170.0080.00016.89
8.0.160.0040.00416.96
8.0.150.0000.00716.75
8.0.140.0040.00416.68
8.0.130.0030.00313.32
8.0.120.0040.00416.69
8.0.110.0050.00216.81
8.0.100.0030.00316.86
8.0.90.0000.00716.77
8.0.80.0060.01216.88
8.0.70.0000.00716.88
8.0.60.0070.00016.82
8.0.50.0070.00016.87
8.0.30.0100.01016.94
8.0.20.0080.01117.40
8.0.10.0040.00417.02
8.0.00.0090.00816.85
7.4.330.0050.00016.66
7.4.320.0000.00816.59
7.4.300.0030.00316.51
7.4.290.0000.00716.57
7.4.280.0050.00516.54
7.4.270.0040.00416.56
7.4.260.0030.00316.59
7.4.250.0050.00316.37
7.4.240.0070.00016.55
7.4.230.0030.00316.55
7.4.220.0110.00816.70
7.4.210.0090.00916.56
7.4.200.0070.00016.45
7.4.160.0060.01016.56
7.4.150.0090.01217.40
7.4.140.0050.01417.86
7.4.130.0150.00316.31
7.4.120.0110.01316.45
7.4.110.0100.00916.48
7.4.100.0140.00316.57
7.4.90.0030.01316.37
7.4.80.0070.01019.39
7.4.70.0000.02016.55
7.4.60.0070.01016.46
7.4.50.0110.00516.50
7.4.40.0070.01016.48
7.4.30.0120.01216.42
7.4.00.0070.01014.99
7.3.330.0030.00313.37
7.3.320.0000.00613.27
7.3.310.0000.00716.24
7.3.300.0080.00016.23
7.3.290.0080.00816.36
7.3.280.0130.00516.40
7.3.270.0090.00917.40
7.3.260.0080.00816.49
7.3.240.0100.00616.63
7.3.230.0100.00716.46
7.3.210.0040.01516.41
7.3.200.0100.00716.46
7.3.190.0100.00616.45
7.3.180.0060.01116.34
7.3.170.0030.01516.58
7.3.160.0030.01216.41
7.3.120.0090.00614.77
7.3.110.0150.00014.57
7.3.100.0120.00414.79
7.3.90.0060.00614.98
7.3.80.0090.00014.49
7.3.70.0070.00715.00
7.3.60.0000.01414.75
7.3.50.0080.00414.89
7.3.40.0070.01014.89
7.3.30.0030.00614.86
7.3.20.0030.01016.38
7.3.10.0130.00316.80
7.3.00.0000.01516.44
7.2.330.0100.00716.72
7.2.320.0070.01016.70
7.2.310.0060.01016.77
7.2.300.0090.00616.57
7.2.290.0130.00316.65
7.2.250.0030.01614.74
7.2.240.0030.01615.10
7.2.230.0000.01714.92
7.2.220.0040.00715.27
7.2.210.0060.00914.93
7.2.200.0110.00314.95
7.2.190.0030.01014.80
7.2.180.0070.00715.06
7.2.170.0060.01215.11
7.2.60.0070.00716.70
7.2.00.0030.00619.59
7.1.330.0070.00715.57
7.1.320.0050.00515.72
7.1.310.0070.01115.92
7.1.300.0030.01015.82
7.1.290.0040.01115.68
7.1.280.0060.00315.76
7.1.270.0070.00715.67
7.1.260.0000.00915.60
7.1.200.0060.00815.67
7.1.100.0000.01118.21
7.1.70.0030.01017.01
7.1.60.0060.00919.13
7.1.50.0110.01117.10
7.1.00.0070.07322.35
7.0.200.0200.00514.89
7.0.60.0070.04020.01
7.0.50.0000.04317.73
7.0.40.0030.04319.96
7.0.30.0470.07720.33
7.0.20.0270.08720.33
7.0.10.0070.04320.12
7.0.00.0030.04320.33
5.6.280.0030.06721.10
5.6.210.0070.08320.77
5.6.200.0030.08318.18
5.6.190.0070.08020.46
5.6.180.0270.07720.50
5.6.170.0170.04720.48
5.6.160.0000.04320.52
5.6.150.0070.04318.15
5.6.140.0070.06018.21
5.6.130.0030.04018.14
5.6.120.0100.08321.02
5.6.110.0130.08021.13
5.6.100.0030.05720.89
5.6.90.0130.08020.98
5.6.80.0100.04020.38
5.5.350.0170.07320.39
5.5.340.0130.07318.05
5.5.330.0100.07720.41
5.5.320.0200.04320.36
5.5.310.0200.07020.41
5.5.300.0070.04717.97
5.5.290.0070.08318.03
5.5.280.0100.08020.74
5.5.270.0030.06020.87
5.5.260.0130.06320.87
5.5.250.0130.04720.79
5.5.240.0200.04020.26

preferences:
53.02 ms | 401 KiB | 5 Q