3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private DateTimeImmutable $bar; private ?string $foo; public function getBar(): DateTimeImmutable { return $this->bar ??= new DateTimeImmutable(); } public static function getFoo(): ?string { return $this->foo ??= null; } public static function setFoo(string $foo): self { $this->foo = $foo; return $this; } } $foo = new Foo(); var_dump($foo->getBar()); var_dump($foo->getBar()); var_dump($foo->getFoo()); $foo->setFoo('test'); var_dump($foo->getFoo());

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.0130.00718.68
8.3.50.0150.00018.18
8.3.40.0070.01419.17
8.3.30.0150.00618.91
8.3.20.0110.00720.85
8.3.10.0070.01020.34
8.3.00.0110.00722.34
8.2.180.0160.00618.63
8.2.170.0110.00822.96
8.2.160.0070.00722.26
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0040.00419.76
8.2.110.0100.00022.00
8.2.100.0060.00617.97
8.2.90.0000.00917.89
8.2.80.0000.00819.10
8.2.70.0040.00718.00
8.2.60.0000.00818.26
8.2.50.0030.00618.10
8.2.40.0080.00019.47
8.2.30.0040.00419.32
8.2.20.0000.00818.05
8.2.10.0050.00319.04
8.2.00.0050.00319.31
8.1.280.0070.00725.92
8.1.270.0080.00020.51
8.1.260.0090.00026.35
8.1.250.0000.00828.09
8.1.240.0060.00322.02
8.1.230.0080.00420.96
8.1.220.0080.00017.74
8.1.210.0060.00318.84
8.1.200.0000.00917.48
8.1.190.0030.00617.38
8.1.180.0040.00418.84
8.1.170.0030.00618.62
8.1.160.0000.00718.99
8.1.150.0040.00418.90
8.1.140.0030.00522.11
8.1.130.0030.00319.98
8.1.120.0040.00417.59
8.1.110.0000.00817.61
8.1.100.0080.00017.58
8.1.90.0040.00417.61
8.1.80.0000.00717.63
8.1.70.0030.00317.64
8.1.60.0040.00417.60
8.1.50.0000.00817.54
8.1.40.0030.00517.53
8.1.30.0000.00817.85
8.1.20.0030.00517.77
8.1.10.0040.00417.65
8.1.00.0000.00817.59
8.0.300.0050.00320.09
8.0.290.0070.00416.88
8.0.280.0000.00718.41
8.0.270.0040.00417.34
8.0.260.0040.00420.06
8.0.250.0030.00317.19
8.0.240.0000.00717.12
8.0.230.0000.00717.18
8.0.220.0030.00617.09
8.0.210.0030.00317.01
8.0.200.0000.00617.06
8.0.190.0040.00417.15
8.0.180.0000.00717.02
8.0.170.0000.01116.99
8.0.160.0000.00717.05
8.0.150.0000.00717.03
8.0.140.0050.00217.05
8.0.130.0000.00613.37
8.0.120.0000.00816.94
8.0.110.0040.00416.91
8.0.100.0040.00417.02
8.0.90.0060.00317.03
8.0.80.0070.01417.11
8.0.70.0040.00417.07
8.0.60.0050.00316.96
8.0.50.0040.00417.01
8.0.30.0130.01017.43
8.0.20.0140.00517.18
8.0.10.0000.00817.18
8.0.00.0150.00416.98
7.4.330.0050.00015.55
7.4.320.0040.00416.66
7.4.300.0040.00416.63
7.4.290.0030.00616.67
7.4.280.0040.00416.78
7.4.270.0000.00716.64
7.4.260.0000.00513.26
7.4.250.0030.00516.54
7.4.240.0030.00516.70
7.4.230.0030.00316.53
7.4.220.0020.00616.60
7.4.210.0110.00616.72
7.4.200.0070.00016.85
7.4.130.0150.00316.87
7.4.120.0110.00916.69
7.4.110.0120.01216.77
7.4.100.0060.01316.86
7.4.90.0070.01116.94
7.4.80.0170.00019.39
7.4.70.0110.00616.62
7.4.60.0070.01016.61
7.4.50.0120.00016.71
7.4.40.0130.00316.70
7.4.00.0100.00715.35
7.3.330.0110.00016.21
7.3.320.0060.00013.18
7.3.310.0000.00716.26
7.3.300.0030.00316.06
7.3.290.0080.00616.15
7.3.280.0120.01016.17
7.3.260.0070.01716.16
7.3.240.0040.01316.20
7.3.230.0040.01216.25
7.3.210.0030.01316.22
7.3.200.0150.00316.14
7.3.190.0100.00716.23
7.3.180.0070.01016.46
7.3.170.0100.00716.21
7.3.160.0060.00916.44
7.3.120.0090.00914.48
7.3.110.0120.00614.70
7.3.100.0060.01714.30
7.3.90.0120.00414.42
7.3.80.0110.00414.72
7.3.70.0140.00514.60
7.3.60.0120.00314.59
7.3.50.0130.00314.43
7.3.40.0130.00314.62
7.3.30.0090.00914.76
7.3.20.0100.01014.43
7.3.10.0140.00314.45
7.3.00.0150.00214.78
7.2.330.0030.01516.17
7.2.320.0160.00016.21
7.2.310.0080.00816.43
7.2.300.0140.00316.34
7.2.290.0060.01016.66
7.2.250.0060.01314.64
7.2.240.0120.01214.68
7.2.230.0110.01114.66
7.2.220.0080.01014.61
7.2.210.0070.01314.91
7.2.200.0100.00614.65
7.2.190.0090.00914.74
7.2.180.0110.00414.88
7.2.170.0060.01214.56
7.1.330.0060.01013.55
7.1.320.0060.01213.84
7.1.310.0080.00813.64
7.1.300.0090.00613.54
7.1.290.0120.00413.78
7.1.280.0200.00013.62
7.1.270.0050.00913.55
7.1.260.0030.01313.68

preferences:
83.35 ms | 401 KiB | 5 Q