3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SomeImmutableObject { private $someString; private $flagCreate = false; public function __construct(string $value) { if ($this->flagCreate === true) { throw new \BadMethodCallException('This is an immutable object has already create.'); } $this->someString = $value; $this->flagCreate = true; } public function getValue(): string { return 'the value is:' . $this->someString . ' - '; } } class AnotherClassToBreakImmutableObject extends SomeImmutableObject { public function __construct(string $value) { $this->someString = $value; } public function getValue(): string { return 'the value is:' . $this->someString . ' - '; } public function change(): void { $this->someString .= ' and Minny'; } } $three = new AnotherClassToBreakImmutableObject('Pippo'); echo $three->getValue(); //Pippo echo $three->change(); echo $three->getValue(); //the value is: Pippo and Minny -

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.00418.42
8.3.50.0100.01016.20
8.3.40.0070.01020.50
8.3.30.0090.00618.79
8.3.20.0000.00721.08
8.3.10.0070.00020.34
8.3.00.0000.00822.43
8.2.180.0090.00916.75
8.2.170.0070.00722.96
8.2.160.0000.01319.33
8.2.150.0050.00224.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0030.00526.16
8.2.110.0130.00020.47
8.2.100.0080.00417.91
8.2.90.0000.00917.63
8.2.80.0030.00618.78
8.2.70.0030.00617.63
8.2.60.0030.00517.78
8.2.50.0000.00818.05
8.2.40.0040.00418.16
8.2.30.0040.00419.36
8.2.20.0040.00418.18
8.2.10.0040.00419.18
8.2.00.0050.00219.30
8.1.280.0160.00325.92
8.1.270.0110.00323.97
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0090.00023.82
8.1.230.0080.00421.25
8.1.220.0000.00717.77
8.1.210.0040.00418.77
8.1.200.0050.00517.35
8.1.190.0050.00317.23
8.1.180.0060.00318.10
8.1.170.0000.00917.62
8.1.160.0070.00018.89
8.1.150.0000.00718.79
8.1.140.0000.00718.89
8.1.130.0030.00320.25
8.1.120.0000.00717.44
8.1.110.0030.00917.35
8.1.100.0040.00417.49
8.1.90.0040.00417.43
8.1.80.0000.00717.47
8.1.70.0070.00017.34
8.1.60.0000.00817.63
8.1.50.0040.00417.51
8.1.40.0000.00717.56
8.1.30.0040.00417.55
8.1.20.0040.00417.62
8.1.10.0020.00517.48
8.1.00.0040.00717.52
8.0.300.0000.00718.77
8.0.290.0000.00816.75
8.0.280.0030.00318.37
8.0.270.0030.00317.97
8.0.260.0030.00319.97
8.0.250.0000.00816.92
8.0.240.0070.00016.92
8.0.230.0000.00716.96
8.0.220.0030.00516.82
8.0.210.0070.00016.82
8.0.200.0040.00416.93
8.0.190.0000.00716.97
8.0.180.0000.00816.87
8.0.170.0000.00816.89
8.0.160.0000.00716.90
8.0.150.0060.00316.72
8.0.140.0060.00316.84
8.0.130.0060.00013.28
8.0.120.0040.00416.86
8.0.110.0070.00016.91
8.0.100.0040.00416.82
8.0.90.0060.00316.78
8.0.80.0080.01116.87
8.0.70.0030.00516.93
8.0.60.0000.00716.68
8.0.50.0060.00316.73
8.0.30.0080.00817.27
8.0.20.0080.01317.18
8.0.10.0000.00717.00
8.0.00.0120.00616.48
7.4.330.0020.00215.55
7.4.320.0060.00016.34
7.4.300.0000.00816.63
7.4.290.0000.00916.58
7.4.280.0050.00316.48
7.4.270.0000.00716.51
7.4.260.0070.00016.48
7.4.250.0000.00716.56
7.4.240.0010.00616.51
7.4.230.0030.00616.34
7.4.220.0000.00716.44
7.4.210.0080.00716.59
7.4.200.0040.00416.53
7.4.130.0170.00516.58
7.4.120.0100.00716.40
7.4.110.0060.01516.39
7.4.100.0050.01116.41
7.4.90.0100.00716.34
7.4.80.0140.00819.39
7.4.70.0070.01016.66
7.4.60.0070.01016.25
7.4.50.0080.00816.57
7.4.40.0000.01516.50
7.4.30.0090.00616.31
7.4.20.0100.00616.42
7.4.10.0060.00916.53
7.4.00.0090.00616.64
7.3.330.0000.00716.11
7.3.320.0020.00213.24
7.3.310.0000.00716.21
7.3.300.0030.00316.31
7.3.290.0060.00816.33
7.3.280.0070.01116.27
7.3.260.0120.01016.36
7.3.240.0080.00916.35
7.3.230.0030.01516.62
7.3.210.0060.01216.27
7.3.200.0060.01116.23
7.3.190.0130.00816.41
7.3.180.0080.01116.31
7.3.170.0090.00916.32
7.3.160.0120.00416.37
7.3.150.0090.00616.38
7.3.140.0090.00616.25
7.3.130.0030.01216.37
7.3.120.0110.00316.19
7.3.110.0090.00616.05
7.3.100.0120.00316.41
7.3.90.0060.00916.52
7.3.80.0120.00316.22
7.3.70.0040.01116.41
7.3.60.0060.00916.25
7.3.50.0070.00716.22
7.3.40.0090.00616.18
7.3.30.0070.00816.16
7.3.20.0140.00316.27
7.3.10.0060.00916.27
7.3.00.0090.00616.27
7.2.330.0080.00916.91
7.2.320.0080.00816.59
7.2.310.0090.00916.40
7.2.300.0090.01616.77
7.2.290.0100.00716.54
7.2.280.0110.00516.38
7.2.270.0030.01216.44
7.2.260.0030.01316.85
7.2.250.0030.01316.75
7.2.240.0060.00916.40
7.2.230.0100.00616.81
7.2.220.0030.01216.77
7.2.210.0080.00816.28
7.2.200.0130.00316.43
7.2.190.0120.00416.59
7.2.180.0030.01216.52
7.2.170.0060.00916.55
7.2.160.0060.01016.54
7.2.150.0110.00716.77
7.2.140.0090.00616.79
7.2.130.0030.01316.82
7.2.120.0060.00916.65
7.2.110.0080.00816.73
7.2.100.0100.00716.64
7.2.90.0140.00316.66
7.2.80.0120.00316.56
7.2.70.0150.00316.54
7.2.60.0100.00616.53
7.2.50.0110.00516.35
7.2.40.0110.00416.50
7.2.30.0070.00716.68
7.2.20.0050.01016.59
7.2.10.0070.00716.67
7.2.00.0090.00616.45

preferences:
69.72 ms | 401 KiB | 5 Q