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 immutable object has already been created.'); } $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 Baz'; } } $three = new AnotherClassToBreakImmutableObject('Foo'); echo $three->getValue(); //Foo echo $three->change(); echo $three->getValue(); //the value is: Foo and Baz -

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.5.10.0110.00716.71
8.5.00.0130.00920.02
8.4.150.0020.00114.05
8.4.140.0130.01217.48
8.4.130.0090.01119.62
8.4.120.0130.00720.65
8.4.110.0090.00922.73
8.4.100.0140.00717.94
8.4.90.0110.00917.85
8.4.80.0070.00417.86
8.4.70.0030.00617.84
8.4.60.0110.00918.51
8.4.50.0040.00517.90
8.4.40.0160.00317.69
8.4.30.0000.00820.50
8.4.20.0070.01318.80
8.4.10.0040.00420.50
8.3.280.0110.00920.22
8.3.270.0080.01116.79
8.3.260.0130.00616.73
8.3.250.0050.00318.85
8.3.240.0100.00917.35
8.3.230.0060.00216.81
8.3.220.0110.00817.16
8.3.210.0050.00316.74
8.3.200.0020.00616.84
8.3.190.0100.00817.09
8.3.180.0060.00416.57
8.3.170.0070.00019.12
8.3.160.0040.00417.17
8.3.150.0160.00320.61
8.3.140.0000.00816.66
8.3.130.0030.00918.62
8.3.120.0040.00418.85
8.3.110.0060.00320.94
8.3.100.0060.00318.56
8.3.90.0030.00626.77
8.3.80.0060.00316.88
8.3.70.0100.01016.73
8.3.60.0100.01318.38
8.3.50.0110.01123.54
8.3.40.0080.00818.87
8.3.30.0000.01519.02
8.3.20.0050.00224.18
8.3.10.0050.00324.66
8.3.00.0070.00026.16
8.2.290.0100.00920.39
8.2.280.0090.00916.58
8.2.270.0180.00017.08
8.2.260.0150.00316.70
8.2.250.0080.00016.80
8.2.240.0060.00618.78
8.2.230.0060.00322.58
8.2.220.0090.00624.06
8.2.210.0100.00726.77
8.2.200.0090.00018.54
8.2.190.0150.00018.66
8.2.180.0090.00625.92
8.2.170.0100.00718.82
8.2.160.0100.00722.96
8.2.150.0060.00325.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0030.00519.48
8.2.110.0060.00320.38
8.2.100.0110.00017.91
8.2.90.0040.00418.13
8.2.80.0000.00818.16
8.2.70.0040.00417.50
8.2.60.0090.00017.50
8.2.50.0000.00817.63
8.2.40.0000.00819.34
8.2.30.0040.00419.27
8.2.20.0000.00717.99
8.2.10.0060.00319.25
8.2.00.0040.00419.36
8.1.330.0100.00821.91
8.1.320.0110.00517.77
8.1.310.0140.00318.24
8.1.300.0000.00816.19
8.1.290.0060.00330.84
8.1.280.0160.00325.92
8.1.270.0080.00023.99
8.1.260.0050.00326.35
8.1.250.0000.00828.09
8.1.240.0060.00323.73
8.1.230.0080.00322.16
8.1.220.0060.00317.78
8.1.210.0040.00418.79
8.1.200.0060.00317.38
8.1.190.0050.00317.35
8.1.180.0040.00718.10
8.1.170.0040.00418.45
8.1.160.0040.00418.97
8.1.150.0040.00418.89
8.1.140.0000.00818.87
8.1.130.0000.00720.16
8.1.120.0030.00617.46
8.1.110.0000.00817.37
8.1.100.0040.00417.43
8.1.90.0000.00717.47
8.1.80.0040.00417.52
8.1.70.0000.00717.51
8.1.60.0060.00317.57
8.1.50.0030.00517.38
8.1.40.0050.00317.57
8.1.30.0040.00417.48
8.1.20.0040.00417.61
8.1.10.0050.00317.48
8.1.00.0050.00317.42
8.0.300.0040.00419.76
8.0.290.0040.00416.63
8.0.280.0000.00718.38
8.0.270.0000.00816.76
8.0.260.0030.00318.35
8.0.250.0030.00316.96
8.0.240.0030.00316.96
8.0.230.0000.00716.96
8.0.220.0030.00316.88
8.0.210.0030.00316.89
8.0.200.0060.00316.92
8.0.190.0000.00816.95
8.0.180.0070.00016.95
8.0.170.0060.00316.91
8.0.160.0050.00316.85
8.0.150.0000.00716.74
8.0.140.0000.00816.77
8.0.130.0000.00513.36
8.0.120.0050.00316.89
8.0.110.0050.00216.84
8.0.100.0000.00716.89
8.0.90.0070.00016.89
8.0.80.0080.00816.85
8.0.70.0000.00716.85
8.0.60.0040.00416.79
8.0.50.0040.00416.71
8.0.30.0190.00317.21
8.0.20.0160.01017.23
8.0.10.0070.00016.87
8.0.00.0110.01416.63
7.4.330.0000.00415.55
7.4.320.0030.00316.54
7.4.300.0030.00316.51
7.4.290.0060.00316.60
7.4.280.0030.00516.57
7.4.270.0030.00316.52
7.4.260.0000.00613.27
7.4.250.0080.00016.47
7.4.240.0020.00516.51
7.4.230.0030.00316.58
7.4.220.0030.00316.69
7.4.210.0060.01116.54
7.4.200.0070.00016.58
7.4.130.0100.01116.46
7.4.120.0070.01016.42
7.4.110.0090.01616.66
7.4.100.0120.00616.57
7.4.90.0090.00916.44
7.4.80.0060.01319.39
7.4.70.0060.02019.39
7.4.60.0110.00819.39
7.4.50.0110.00719.39
7.4.40.0160.00519.39
7.4.30.0130.00319.39
7.4.20.0040.01319.39
7.4.10.0060.01319.39
7.4.00.0090.00919.39
7.3.330.0030.00316.21
7.3.320.0000.00513.27
7.3.310.0030.00316.21
7.3.300.0060.00016.32
7.3.290.0060.00816.25
7.3.280.0090.00616.29
7.3.260.0100.00716.18
7.3.230.0070.01016.59
7.3.210.0130.00516.39
7.3.200.0050.01119.39
7.3.190.0120.00919.39
7.3.180.0130.00819.39
7.3.170.0180.01919.39
7.3.160.0140.00719.39
7.3.150.0060.01119.39
7.3.140.0060.01519.39
7.3.130.0000.02319.39
7.3.120.0160.00419.39
7.3.110.0110.00719.39
7.3.100.0100.00719.39
7.3.90.0070.01319.39
7.3.80.0080.01119.39
7.3.70.0080.01119.39
7.3.60.0070.01619.39
7.3.50.0130.00919.39
7.3.40.0080.00819.39
7.3.30.0140.00619.39
7.3.20.0060.01319.39
7.3.10.0030.01619.39
7.3.00.0060.01519.39
7.2.330.0100.01616.75
7.2.320.0150.00919.39
7.2.310.0040.01319.39
7.2.300.0180.00419.39
7.2.290.0130.00319.39
7.2.280.0110.00719.39
7.2.270.0190.00019.39
7.2.260.0100.01319.39
7.2.250.0110.00819.39
7.2.240.0100.01019.39
7.2.230.0060.01519.39
7.2.220.0070.01119.39
7.2.210.0120.00819.39
7.2.200.0100.01319.39
7.2.190.0150.00819.39
7.2.180.0060.01219.39
7.2.170.0220.00419.39
7.2.160.0130.00619.39
7.2.150.0250.01419.39
7.2.140.0090.01219.39
7.2.130.0070.01519.39
7.2.120.0220.00019.39
7.2.110.0190.00019.39
7.2.100.0160.00419.39
7.2.90.0060.01719.39
7.2.80.0130.00719.39
7.2.70.0120.00619.39
7.2.60.0100.00919.39
7.2.50.0140.01119.39
7.2.40.0160.00319.39
7.2.30.0120.00819.39
7.2.20.0100.01019.39
7.2.10.0570.01319.39
7.2.00.0110.00819.39

preferences:
44.94 ms | 403 KiB | 5 Q