3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Immutable { private static $sealed = array(); public function __set($name, $value) { if (isset(self::$sealed[spl_object_hash($this)])) { throw new Exception("can't touch this, nah nah nuh nahhh"); } $this->$name = $value; } public function __get($name) { return $this->$name; } protected function seal() { self::$sealed[spl_object_hash($this)] = true; } } class ImmutableThingy { use Immutable; protected $foo; public function __construct($foo) { $this->foo = $foo; $this->seal(); // What the fuck ever broh } } $thing = new ImmutableThingy("bar"); var_dump($thing, $thing->foo); $thing->foo = 'baz'; var_dump($thing, $thing->foo);

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.40.0090.00618.84
8.3.30.0150.00318.79
8.3.20.0070.00020.16
8.3.10.0040.00421.97
8.3.00.0000.00721.74
8.2.170.0080.00822.96
8.2.160.0040.01620.52
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0050.00320.78
8.2.120.0070.00026.35
8.2.110.0030.00620.35
8.2.100.0070.00418.03
8.2.90.0030.00619.17
8.2.80.0000.00817.97
8.2.70.0040.00417.63
8.2.60.0000.00818.16
8.2.50.0000.00818.09
8.2.40.0080.00022.16
8.2.30.0070.00019.38
8.2.20.0040.00417.85
8.2.10.0000.00818.05
8.2.00.0000.00818.16
8.1.270.0070.01122.11
8.1.260.0020.00528.09
8.1.250.0080.00028.09
8.1.240.0090.00023.98
8.1.230.0100.00022.31
8.1.220.0000.00817.78
8.1.210.0070.00318.77
8.1.200.0060.00617.38
8.1.190.0030.00517.36
8.1.180.0030.00518.10
8.1.170.0080.00018.59
8.1.160.0000.00920.77
8.1.150.0070.00020.85
8.1.140.0030.00519.56
8.1.130.0030.00317.82
8.1.120.0000.00817.43
8.1.110.0040.00417.39
8.1.100.0040.00417.38
8.1.90.0000.00717.37
8.1.80.0000.00717.44
8.1.70.0030.00317.47
8.1.60.0090.00017.60
8.1.50.0040.00417.56
8.1.40.0040.00417.58
8.1.30.0000.00817.61
8.1.20.0030.00717.73
8.1.10.0000.00717.48
8.1.00.0000.00717.41
8.0.300.0000.00718.77
8.0.290.0000.00716.75
8.0.280.0070.00018.38
8.0.270.0040.00417.31
8.0.260.0030.00517.18
8.0.250.0030.00316.97
8.0.240.0060.00017.07
8.0.230.0000.00716.91
8.0.220.0060.00316.87
8.0.210.0000.00716.85
8.0.200.0060.00017.00
8.0.190.0080.00016.86
8.0.180.0040.00416.98
8.0.170.0050.00316.95
8.0.160.0040.00416.96
8.0.150.0030.00516.84
8.0.140.0030.00416.81
8.0.130.0030.00313.38
8.0.120.0060.00316.89
8.0.110.0070.00016.98
8.0.100.0000.00717.03
8.0.90.0040.00416.79
8.0.80.0100.00716.93
8.0.70.0000.00716.92
8.0.60.0040.00416.96
8.0.50.0050.00216.96
8.0.30.0080.01417.22
8.0.20.0090.01017.40
8.0.10.0080.00016.99
8.0.00.0110.01116.79
7.4.330.0000.00516.89
7.4.320.0000.00616.63
7.4.300.0070.00016.43
7.4.290.0080.00016.65
7.4.280.0040.00416.54
7.4.270.0030.00316.45
7.4.260.0000.00816.49
7.4.250.0040.00416.37
7.4.240.0070.00016.54
7.4.230.0000.00716.68
7.4.220.0140.00716.50
7.4.210.0070.00916.62
7.4.200.0000.00816.45
7.4.160.0080.00816.44
7.4.150.0070.01017.40
7.4.140.0140.00517.86
7.4.130.0080.01016.54
7.4.120.0100.00916.54
7.4.110.0090.00916.55
7.4.100.0100.01016.62
7.4.90.0090.00916.52
7.4.80.0060.01219.39
7.4.70.0100.00616.63
7.4.60.0090.00916.75
7.4.50.0060.01016.64
7.4.40.0160.00016.55
7.4.30.0120.01416.59
7.4.00.0030.01215.17
7.3.330.0030.00313.42
7.3.320.0060.00013.29
7.3.310.0030.00316.29
7.3.300.0070.00016.47
7.3.290.0030.00316.30
7.3.280.0120.00816.43
7.3.270.0100.00617.40
7.3.260.0070.01116.28
7.3.250.0140.00616.44
7.3.240.0100.00716.56
7.3.230.0080.00816.54
7.3.210.0090.01316.39
7.3.200.0080.00819.39
7.3.190.0110.01116.46
7.3.180.0080.00816.43
7.3.170.0070.01016.62
7.3.160.0110.00716.57
7.2.330.0040.01316.80
7.2.320.0130.00616.43
7.2.310.0070.01016.84
7.2.300.0080.00816.85
7.2.290.0100.00716.88
7.2.110.0100.01016.56
7.2.60.0040.01117.06
7.2.00.0030.01019.46
7.1.200.0030.01015.61
7.1.100.0030.00918.13
7.1.70.0040.00417.27
7.1.60.0140.01119.40
7.1.50.0040.01517.03
7.1.00.0000.08022.33
7.0.200.0230.01014.64
7.0.60.0200.07721.72
7.0.50.0070.08017.85
7.0.40.0030.04720.09
7.0.30.0270.05320.34
7.0.20.0330.07720.12
7.0.10.0130.07320.09
7.0.00.0000.04720.15
5.6.280.0030.04321.09
5.6.210.0170.07720.66
5.6.200.0130.05318.25
5.6.190.0100.08320.62
5.6.180.0300.07320.34
5.6.170.0200.08720.47
5.6.160.0130.05320.54
5.6.150.0000.04318.12
5.6.140.0030.06318.22
5.6.130.0000.05718.11
5.6.120.0100.08020.99
5.6.110.0100.09021.09
5.6.100.0030.09020.97
5.6.90.0130.08021.01
5.6.80.0130.06720.52
5.5.350.0170.07720.47
5.5.340.0000.08717.93
5.5.330.0030.05020.25
5.5.320.0470.05720.31
5.5.310.0330.07720.23
5.5.300.0270.03017.93
5.5.290.0000.04717.94
5.5.280.0130.07320.80
5.5.270.0030.04720.88
5.5.260.0130.07720.90
5.5.250.0100.06020.63
5.5.240.4200.04020.29

preferences:
47.51 ms | 400 KiB | 5 Q