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('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.0110.00716.88
8.3.50.0290.00521.98
8.3.40.0070.01018.91
8.3.30.0090.00618.84
8.3.20.0000.00720.34
8.3.10.0000.00823.62
8.3.00.0050.00319.79
8.2.180.0070.01116.63
8.2.170.0090.00622.96
8.2.160.0090.00620.39
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00420.98
8.2.120.0060.00326.35
8.2.110.0090.00322.27
8.2.100.0070.00417.80
8.2.90.0040.00419.05
8.2.80.0040.00417.97
8.2.70.0060.00317.61
8.2.60.0080.00217.77
8.2.50.0030.00618.07
8.2.40.0060.00321.07
8.2.30.0030.00320.71
8.2.20.0080.00017.56
8.2.10.0030.00518.06
8.2.00.0040.00417.91
8.1.280.0040.01125.92
8.1.270.0080.00820.20
8.1.260.0050.00328.09
8.1.250.0000.00728.09
8.1.240.0000.00823.97
8.1.230.0090.00319.04
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0090.00017.25
8.1.190.0040.00417.22
8.1.180.0000.00818.10
8.1.170.0050.00318.50
8.1.160.0040.00420.61
8.1.150.0050.00318.69
8.1.140.0040.00419.38
8.1.130.0030.00517.49
8.1.120.0000.00717.34
8.1.110.0040.00417.24
8.1.100.0040.00417.28
8.1.90.0000.00717.34
8.1.80.0030.00417.30
8.1.70.0040.00417.25
8.1.60.0030.00617.48
8.1.50.0040.00417.48
8.1.40.0020.00517.35
8.1.30.0030.00617.55
8.1.20.0000.00717.49
8.1.10.0050.00217.53
8.1.00.0040.00417.38
8.0.300.0040.00418.77
8.0.290.0070.00016.63
8.0.280.0040.00418.40
8.0.270.0070.00017.21
8.0.260.0000.00617.17
8.0.250.0030.00316.94
8.0.240.0030.00316.96
8.0.230.0070.00316.96
8.0.220.0000.00716.84
8.0.210.0000.00716.94
8.0.200.0000.00616.98
8.0.190.0000.00816.92
8.0.180.0040.00416.93
8.0.170.0050.00216.81
8.0.160.0040.00416.83
8.0.150.0000.00716.77
8.0.140.0040.00416.78
8.0.130.0030.00313.27
8.0.120.0050.00316.76
8.0.110.0000.00716.80
8.0.100.0050.00316.98
8.0.90.0000.00716.94
8.0.80.0170.00316.90
8.0.70.0000.00716.77
8.0.60.0020.00516.90
8.0.50.0000.00716.79
8.0.30.0090.00816.99
8.0.20.0090.01017.41
8.0.10.0000.00716.89
8.0.00.0080.01016.74
7.4.330.0000.00516.73
7.4.320.0060.00016.41
7.4.300.0000.00616.56
7.4.290.0000.00816.40
7.4.280.0030.00516.53
7.4.270.0070.00016.57
7.4.260.0040.00416.58
7.4.250.0000.00816.48
7.4.240.0040.00316.48
7.4.230.0080.00016.37
7.4.220.0100.00716.48
7.4.210.0000.01516.61
7.4.200.0000.00716.57
7.4.160.0060.00916.48
7.4.150.0160.00317.40
7.4.140.0100.01017.86
7.4.130.0120.00616.48
7.4.120.0140.00516.38
7.4.110.0090.00916.66
7.4.100.0070.01016.60
7.4.90.0130.00316.44
7.4.80.0060.01219.39
7.4.70.0000.02016.71
7.4.60.0030.01416.19
7.4.50.0060.00516.34
7.4.40.0160.00016.34
7.4.30.0120.01216.20
7.4.10.0080.01114.99
7.4.00.0120.00715.14
7.3.330.0000.00813.44
7.3.320.0000.00613.33
7.3.310.0000.00716.32
7.3.300.0000.00716.23
7.3.290.0070.01016.38
7.3.280.0080.00916.37
7.3.270.0150.00317.40
7.3.260.0110.00716.61
7.3.240.0110.00816.49
7.3.230.0030.01916.39
7.3.210.0170.00316.25
7.3.200.0090.01716.60
7.3.190.0090.00916.35
7.3.180.0070.01016.57
7.3.170.0140.00316.29
7.3.160.0130.00316.57
7.3.130.0090.00615.14
7.3.120.0130.00614.82
7.3.110.0060.01214.77
7.3.100.0100.00714.95
7.3.90.0080.00814.77
7.3.80.0090.00314.86
7.3.70.0100.00414.69
7.3.60.0000.01114.87
7.3.50.0090.00614.89
7.3.40.0080.00814.86
7.3.30.0030.01214.85
7.3.20.0090.00316.39
7.3.10.0110.00316.57
7.3.00.0010.01216.74
7.2.330.0110.00616.63
7.2.320.0100.00716.51
7.2.310.0130.00416.36
7.2.300.0160.00016.56
7.2.290.0050.01116.24
7.2.260.0070.01115.02
7.2.250.0060.00614.84
7.2.240.0000.01515.15
7.2.230.0040.01415.09
7.2.220.0030.01215.08
7.2.210.0000.01014.70
7.2.200.0060.00914.91
7.2.190.0040.01114.65
7.2.180.0090.00814.74
7.2.170.0080.00814.87
7.2.160.0040.00914.85
7.2.150.0100.00716.71
7.2.140.0070.00716.58
7.2.130.0060.00816.81
7.2.120.0040.00916.66
7.2.110.0050.00716.82
7.2.100.0030.01216.68
7.2.90.0100.00516.88
7.2.80.0060.00916.86
7.2.70.0050.01016.86
7.2.60.0050.00716.53
7.2.50.0100.00916.87
7.2.40.0050.00916.73
7.2.30.0070.00816.85
7.2.20.0030.01216.64
7.2.10.0060.00916.74
7.2.00.0060.00917.53
7.1.330.0030.00915.48
7.1.320.0060.00315.73
7.1.310.0100.00315.36
7.1.300.0030.01015.76
7.1.290.0070.01115.32
7.1.280.0070.00815.67
7.1.270.0070.01015.78
7.1.260.0080.00415.71
7.1.250.0070.00515.56
7.1.240.0090.00315.79
7.1.230.0030.01015.74
7.1.220.0070.00715.71
7.1.210.0150.00015.56
7.1.200.0020.00715.61
7.1.190.0070.01015.64
7.1.180.0060.00615.55
7.1.170.0060.00315.41
7.1.160.0080.00315.43
7.1.150.0000.01115.68
7.1.140.0030.01015.57
7.1.130.0070.00715.81
7.1.120.0130.00015.41
7.1.110.0130.00315.59
7.1.100.0000.01017.00
7.1.90.0070.00315.86
7.1.80.0100.00315.84
7.1.70.0030.00716.32
7.1.60.0060.00717.39
7.1.50.0100.00416.09
7.1.40.0130.00015.72
7.1.30.0100.00315.40
7.1.20.0090.00415.73
7.1.10.0000.01415.70
7.1.00.0050.04219.11
7.0.330.0120.00315.36
7.0.320.0070.00715.36
7.0.310.0060.00615.38
7.0.300.0000.00915.29
7.0.290.0030.00615.31
7.0.280.0030.00715.23
7.0.270.0030.00615.52
7.0.260.0070.00715.33
7.0.250.0090.00315.36
7.0.240.0080.00415.09
7.0.230.0030.01015.18
7.0.220.0080.00415.30
7.0.210.0060.00615.19
7.0.200.0230.00314.83
7.0.190.0110.00315.43
7.0.180.0040.01115.14
7.0.170.0070.00715.41
7.0.160.0090.00615.41
7.0.150.0040.01115.41
7.0.140.0060.00315.36
7.0.130.0070.00715.36
7.0.120.0030.01015.41
7.0.110.0060.00615.35
7.0.100.0030.01015.32
7.0.90.0080.00415.50
7.0.80.0070.00715.29
7.0.70.0070.01015.09
7.0.60.0050.04417.65
7.0.50.0070.04416.58
7.0.40.0050.05017.16
7.0.30.0160.03717.14
7.0.20.0200.04117.18
7.0.10.0080.04317.08
7.0.00.0030.04317.14
5.6.400.0000.01014.38
5.6.390.0000.01614.31
5.6.380.0000.01314.41
5.6.370.0030.01014.10
5.6.360.0000.01114.32
5.6.350.0090.00314.08
5.6.340.0040.00414.34
5.6.330.0060.00814.14
5.6.320.0070.00314.29
5.6.310.0040.00414.11
5.6.300.0000.01514.16
5.6.290.0070.00714.06
5.6.280.0050.04017.56
5.6.270.0100.00314.06
5.6.260.0100.00314.22
5.6.250.0080.00614.25
5.6.240.0060.00814.09
5.6.230.0060.00914.06
5.6.220.0060.00914.06
5.6.210.0060.02317.34
5.6.200.0060.02516.26
5.6.190.0080.04817.24
5.6.180.0140.04217.37
5.6.170.0100.02717.24
5.6.160.0030.02717.32
5.6.150.0100.03016.31
5.6.140.0030.04216.15
5.6.130.0030.02516.13
5.6.120.0020.02717.48
5.6.110.0120.02817.53
5.6.100.0080.02717.53
5.6.90.0090.04217.59
5.6.80.0050.04217.41
5.6.70.0070.00714.16
5.6.60.0000.01714.06
5.6.50.0060.00614.06
5.6.40.0070.00714.06
5.6.30.0090.00614.07
5.6.20.0100.00614.06
5.6.10.0070.01014.16
5.6.00.0100.00314.12
5.5.380.0030.01514.06
5.5.370.0100.00614.06
5.5.360.0070.00714.13
5.5.350.0100.04217.30
5.5.340.0050.04815.99
5.5.330.0030.04217.16
5.5.320.0240.02517.19
5.5.310.0100.03617.28
5.5.300.0050.04316.11
5.5.290.0080.04516.05
5.5.280.0040.02417.58
5.5.270.0070.02517.48
5.5.260.0070.04817.52
5.5.250.0050.04017.29
5.5.240.0120.02017.11
5.5.230.0030.00914.06
5.5.220.0090.00314.06
5.5.210.0140.00014.06
5.5.200.0110.00314.27
5.5.190.0080.00814.06
5.5.180.0000.00914.08
5.5.170.0090.00614.06
5.5.160.0110.00314.16
5.5.150.0030.00714.06
5.5.140.0000.01014.07
5.5.130.0030.00914.06
5.5.120.0060.00814.08
5.5.110.0000.01414.09
5.5.100.0060.00614.09
5.5.90.0040.01114.06
5.5.80.0100.00714.23
5.5.70.0040.01114.06
5.5.60.0060.01214.06
5.5.50.0040.00714.22
5.5.40.0060.00614.06
5.5.30.0090.00614.06
5.5.20.0070.01014.06
5.5.10.0090.00614.09
5.5.00.0070.00714.06

preferences:
53.15 ms | 401 KiB | 5 Q