3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare (strict_types=1); final class Immutable { private $views; public function __construct(int $views) { $this->views = $views; } public function increaseViews(int $views): self { $this->views += $views; return new self($this->views); } public function getViews(): int { return $this->views; } } $imm = new Immutable(1); $imm->increaseViews(3); $imm->increaseViews(3); $imm->increaseViews(3); $imm->increaseViews(3); $imm->increaseViews(3); $imm->increaseViews(3); $imm->increaseViews(3); $imm->increaseViews(3); $imm->increaseViews(3); print $imm->getViews();

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.0090.00618.38
8.3.50.0040.01118.45
8.3.40.0060.00918.83
8.3.30.0110.00418.43
8.3.20.0000.00819.27
8.3.10.0040.00420.92
8.3.00.0040.00423.65
8.2.180.0140.00418.22
8.2.170.0060.00922.96
8.2.160.0140.00020.43
8.2.150.0030.00624.18
8.2.140.0000.00724.66
8.2.130.0000.00819.83
8.2.120.0000.00726.35
8.2.110.0060.00321.12
8.2.100.0080.00317.91
8.2.90.0090.00019.17
8.2.80.0030.00518.03
8.2.70.0000.00817.93
8.2.60.0000.00817.91
8.2.50.0030.00718.10
8.2.40.0040.00419.48
8.2.30.0050.00219.51
8.2.20.0000.00718.12
8.2.10.0000.00919.92
8.2.00.0040.00419.33
8.1.280.0080.01525.92
8.1.270.0080.00023.99
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0040.00423.77
8.1.230.0110.00017.71
8.1.220.0040.00417.78
8.1.210.0030.00618.77
8.1.200.0030.00617.25
8.1.190.0000.00917.13
8.1.180.0050.00218.10
8.1.170.0040.00418.65
8.1.160.0040.00418.77
8.1.150.0000.00718.78
8.1.140.0000.00717.67
8.1.130.0000.00719.10
8.1.120.0000.00717.42
8.1.110.0000.00717.40
8.1.100.0040.00417.43
8.1.90.0040.00417.41
8.1.80.0000.00717.38
8.1.70.0040.00417.44
8.1.60.0030.00717.56
8.1.50.0070.00317.58
8.1.40.0050.00317.51
8.1.30.0020.00517.75
8.1.20.0030.00517.58
8.1.10.0000.01017.49
8.1.00.0030.00617.46
8.0.300.0070.00018.77
8.0.290.0070.00016.75
8.0.280.0000.00718.48
8.0.270.0000.00717.21
8.0.260.0030.00317.29
8.0.250.0040.00416.91
8.0.240.0000.00816.99
8.0.230.0040.00416.90
8.0.220.0030.00316.71
8.0.210.0000.00816.88
8.0.200.0030.00316.93
8.0.190.0000.00816.93
8.0.180.0000.01016.79
8.0.170.0050.00316.92
8.0.160.0040.00416.86
8.0.150.0050.00316.71
8.0.140.0070.00016.80
8.0.130.0050.00013.20
8.0.120.0000.00816.72
8.0.110.0050.00316.75
8.0.100.0040.00416.82
8.0.90.0030.00316.67
8.0.80.0080.01116.82
8.0.70.0070.00016.93
8.0.60.0040.00416.98
8.0.50.0000.00716.69
8.0.30.0120.00817.10
8.0.20.0100.01017.40
8.0.10.0000.00816.98
8.0.00.0120.00816.61
7.4.330.0060.00015.55
7.4.320.0030.00316.44
7.4.300.0060.00016.69
7.4.290.0000.00716.48
7.4.280.0000.00716.52
7.4.270.0000.00716.64
7.4.260.0050.00216.62
7.4.250.0000.00716.64
7.4.240.0000.00716.59
7.4.230.0040.00416.55
7.4.220.0030.00516.64
7.4.210.0040.01116.59
7.4.200.0040.00416.47
7.4.160.0060.01216.54
7.4.140.0110.01117.86
7.4.130.0060.02016.58
7.4.120.0100.01016.58
7.4.110.0100.00716.70
7.4.100.0030.01316.68
7.4.90.0100.01316.46
7.4.80.0090.01219.39
7.4.70.0120.00616.52
7.4.60.0030.01316.59
7.4.50.0030.01416.30
7.4.40.0120.01016.33
7.3.330.0000.00513.14
7.3.320.0000.00613.27
7.3.310.0050.00216.24
7.3.300.0040.00416.16
7.3.290.0070.00016.32
7.3.280.0030.01116.26
7.3.260.0100.01016.29
7.3.240.0090.00916.49
7.3.230.0070.01016.23
7.3.210.0130.00316.31
7.3.200.0170.00416.29
7.3.190.0120.00616.32
7.3.180.0080.00816.60
7.3.170.0140.00316.43
7.3.160.0120.00416.42
7.2.330.0100.01016.79
7.2.320.0100.01316.77
7.2.310.0100.00716.62
7.2.300.0170.00716.30
7.2.290.0160.00516.49

preferences:
52.9 ms | 400 KiB | 5 Q