3v4l.org

run code in 200+ PHP versions simultaneously
<?php class Foo { private DateTimeImmutable $bar; private ?string $foo; public function getBar(): DateTimeImmutable { return $this->bar ??= new DateTimeImmutable(); } public function getFoo(): ?string { return $this->foo ??= null; } public 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());
based on MDAPb

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)
7.4.00.0120.00515.09
7.3.120.0060.01014.56
7.3.110.0060.01114.78
7.3.100.0100.00814.47
7.3.90.0050.01214.57
7.3.80.0060.00814.65
7.3.70.0100.00714.52
7.3.60.0100.00714.52
7.3.50.0130.00314.66
7.3.40.0100.00414.52
7.3.30.0070.00814.48
7.3.20.0050.01014.44
7.3.10.0060.00914.51
7.3.00.0110.00814.47
7.2.250.0090.00614.42
7.2.240.0140.00114.69
7.2.230.0050.01214.73
7.2.220.0060.00914.61
7.2.210.0050.01114.90
7.2.200.0060.01314.58
7.2.190.0080.01014.85
7.2.180.0060.00814.64
7.2.170.0070.00914.76
7.2.160.0100.01014.20
7.2.150.0140.00414.59
7.2.140.0120.00614.67
7.2.130.0120.01214.57
7.2.120.0230.00614.51
7.2.110.0130.01014.50
7.2.100.0150.00314.69
7.2.90.0080.01114.40
7.2.80.0040.01214.57
7.2.70.0130.00414.44
7.2.60.0040.01514.11
7.2.50.0040.01214.21
7.2.40.0130.00414.39
7.2.30.0330.00314.76
7.2.20.0100.01014.61
7.2.10.0130.00514.59
7.2.00.0080.00614.63
7.1.330.0090.00613.73
7.1.320.0070.00813.69
7.1.310.0040.01313.80
7.1.300.0140.00113.56
7.1.290.0100.00413.71
7.1.280.0070.00713.65
7.1.270.0090.00513.45
7.1.260.0200.00813.58
7.1.250.0160.00313.42
7.1.240.0130.01313.38
7.1.230.0170.00313.69
7.1.220.0130.00613.65
7.1.210.0150.00413.56
7.1.200.0160.00313.55
7.1.190.0190.00013.58
7.1.180.0120.00613.66
7.1.170.0220.00413.62
7.1.160.0200.00313.67
7.1.150.0110.01113.67
7.1.140.0080.01213.47
7.1.130.0140.01213.68
7.1.120.0110.01113.67
7.1.110.0110.00813.93
7.1.100.0180.00513.41
7.1.90.0100.01013.76
7.1.80.0180.00613.68
7.1.70.0230.00013.55
7.1.60.0130.00613.68
7.1.50.0180.00313.37
7.1.40.0250.01113.73
7.1.30.0180.00313.56
7.1.20.0190.00613.83
7.1.10.0110.01413.44
7.1.00.0210.00013.80
7.0.330.0140.00413.25
7.0.320.0130.00613.24
7.0.310.0100.00813.38
7.0.300.0100.01013.14
7.0.290.0160.00813.29
7.0.280.0220.00713.63
7.0.270.0030.01613.09
7.0.260.0130.00813.51
7.0.250.0140.00513.39
7.0.240.0190.00413.57
7.0.230.0220.00013.29
7.0.220.0080.01213.57
7.0.210.0130.00913.19
7.0.200.0140.00513.34
7.0.190.0110.00813.19
7.0.180.0110.01213.26
7.0.170.0090.01513.42
7.0.160.0210.00313.25
7.0.150.0160.00513.45
7.0.140.0120.00813.09
7.0.130.0120.01213.40
7.0.120.0080.01313.57
7.0.110.0180.00013.28
7.0.100.0130.00713.32
7.0.90.0120.01213.54
7.0.80.0090.00913.33
7.0.70.0140.00713.21
7.0.60.0120.00713.30
7.0.50.0220.00013.44
7.0.40.0110.00813.32
7.0.30.0140.00413.45
7.0.20.0120.00813.48
7.0.10.0420.00613.49
7.0.00.0120.00713.34
5.6.400.0230.00814.12
5.6.390.0070.01213.99
5.6.380.0160.00414.06
5.6.370.0060.01214.02
5.6.360.0140.00814.20
5.6.350.0160.00613.96
5.6.340.0210.00614.10
5.6.330.0090.01614.27
5.6.320.0140.00714.08
5.6.310.0050.01414.20
5.6.300.0110.00814.30
5.6.290.0110.00914.37
5.6.280.0090.01113.87
5.6.270.0150.00314.23
5.6.260.0030.01514.31
5.6.250.0100.01314.00
5.6.240.0160.00513.89
5.6.230.0100.01014.20
5.6.220.0110.01414.06
5.6.210.0080.01113.90
5.6.200.0110.00814.05
5.6.190.0090.00914.25
5.6.180.0080.01113.90
5.6.170.0030.01514.36
5.6.160.0080.01213.92
5.6.150.0160.00014.18
5.6.140.0140.00714.20
5.6.130.0210.00813.86
5.6.120.0160.01214.00
5.6.110.0200.00313.80
5.6.100.0190.00014.10
5.6.90.0110.00714.07
5.6.80.0060.01214.20
5.6.70.0120.00614.05
5.6.60.0160.00413.95
5.6.50.0140.00913.88
5.6.40.0150.00413.89
5.6.30.0100.01013.94
5.6.20.0100.01014.16
5.6.10.0040.01913.85
5.6.00.0110.01114.02
5.5.380.0160.00714.01
5.5.370.0070.01513.84
5.5.360.0160.00813.87
5.5.350.0140.01013.89
5.5.340.0140.00514.35
5.5.330.0080.01113.92
5.5.320.0110.01114.02
5.5.310.0170.01014.07
5.5.300.0180.00314.08
5.5.290.0120.01214.06
5.5.280.0110.01614.16
5.5.270.0060.01314.32
5.5.260.0050.01414.01
5.5.250.0060.01413.67
5.5.240.0120.00614.09
5.5.230.0110.00713.64
5.5.220.0050.01413.88
5.5.210.0180.00413.80
5.5.200.0070.01313.74
5.5.190.0100.01013.88
5.5.180.0130.00914.07
5.5.170.0120.01213.70
5.5.160.0110.01513.99
5.5.150.0180.00413.98
5.5.140.0080.01214.01
5.5.130.0140.00613.82
5.5.120.0190.00613.76
5.5.110.0080.01314.12
5.5.100.0140.01014.14
5.5.90.0080.01113.86
5.5.80.0120.01213.90
5.5.70.0110.01113.84
5.5.60.0190.00713.71
5.5.50.0090.00914.09
5.5.40.0130.00514.06
5.5.30.0160.00713.90
5.5.20.0140.00314.19
5.5.10.0100.00814.00
5.5.00.0060.01113.89
5.4.450.0120.00810.99
5.4.440.0110.00810.80
5.4.430.0110.00410.56
5.4.420.0090.00410.79
5.4.410.0070.00710.83
5.4.400.0070.00710.70
5.4.390.0130.00010.66
5.4.380.0130.00410.47
5.4.370.0110.00610.84
5.4.360.0140.00310.72
5.4.350.0070.01310.85
5.4.340.0050.01010.79
5.4.330.0130.00310.75
5.4.320.0160.00010.67
5.4.310.0120.00410.67
5.4.300.0140.00010.50
5.4.290.0070.00710.73
5.4.280.0050.01110.79
5.4.270.0060.00910.72
5.4.260.0090.00510.51
5.4.250.0150.00010.48
5.4.240.0120.00410.71
5.4.230.0090.00610.46
5.4.220.0100.00710.62
5.4.210.0090.00510.47
5.4.200.0140.00610.86
5.4.190.0080.00510.55
5.4.180.0110.00410.81
5.4.170.0070.00710.80
5.4.160.0070.00710.45
5.4.150.0070.00710.69
5.4.140.0150.00010.74
5.4.130.0040.00910.82
5.4.120.0090.00510.60
5.4.110.0190.00010.45
5.4.100.0050.01411.11
5.4.90.0030.01110.59
5.4.80.0080.00610.92
5.4.70.0100.00210.39
5.4.60.0100.00310.50
5.4.50.0120.00310.87
5.4.40.0040.01110.84
5.4.30.0030.01010.87
5.4.20.0070.00710.73
5.4.10.0100.00610.79
5.4.00.0070.00710.65
5.3.290.0130.00310.39
5.3.280.0160.00010.39
5.3.270.0060.00610.39
5.3.260.0100.00310.39
5.3.250.0060.00610.39
5.3.240.0070.00510.39
5.3.230.0110.00410.39
5.3.220.0080.00810.39
5.3.210.0080.00910.39
5.3.200.0100.00710.39
5.3.190.0110.00310.39
5.3.180.0070.00710.39
5.3.170.0030.00910.39
5.3.160.0160.00010.43
5.3.150.0060.00910.39
5.3.140.0110.00310.39
5.3.130.0080.00410.39
5.3.120.0100.00310.39
5.3.110.0000.01410.39
5.3.100.0130.00010.41
5.3.90.0120.00010.41
5.3.80.0120.00210.39
5.3.70.0130.00010.39
5.3.60.0180.00010.39
5.3.50.0090.00410.39
5.3.40.0090.00410.39
5.3.30.0070.00810.39
5.3.20.0100.00310.39
5.3.10.0030.00910.39
5.3.00.0000.01110.39
5.2.170.0080.00410.39
5.2.160.0030.00810.39
5.2.150.0000.01010.39
5.2.140.0090.00210.39
5.2.130.0080.00310.39
5.2.120.0040.00710.39
5.2.110.0030.00710.39
5.2.100.0000.01110.39
5.2.90.0110.00010.39
5.2.80.0040.00810.39
5.2.70.0080.00310.39
5.2.60.0080.00310.39
5.2.50.0080.00310.39
5.2.40.0060.00410.39
5.2.30.0080.00310.39
5.2.20.0060.00610.39
5.2.10.0060.00610.39
5.2.00.0100.00010.39
5.1.60.0080.00010.39
5.1.50.0000.00910.39
5.1.40.0060.00310.39
5.1.30.0000.00910.39
5.1.20.0030.00610.39
5.1.10.0050.00310.39
5.1.00.0080.00010.39
5.0.50.0070.00010.39
5.0.40.0050.00310.39
5.0.30.0000.00810.39
5.0.20.0040.00410.39
5.0.10.0040.00410.39
5.0.00.0070.00010.39
4.4.90.0000.00610.39
4.4.80.0000.00710.39
4.4.70.0050.00210.39
4.4.60.0070.00010.39
4.4.50.0020.00410.39
4.4.40.0070.00410.39
4.4.30.0050.00410.39
4.4.20.0000.00610.39
4.4.10.0030.00310.39
4.4.00.0060.00010.39
4.3.110.0020.00410.39
4.3.100.0040.00210.39
4.3.90.0060.00010.39
4.3.80.0000.00710.39
4.3.70.0000.00610.39
4.3.60.0030.00310.39
4.3.50.0040.00210.39
4.3.40.0060.00010.39
4.3.30.0060.00010.39
4.3.20.0030.00310.39
4.3.10.0040.00210.39
4.3.00.0060.00010.39