3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Immutable { private $_defaultValues = []; private $_userDefinedValues = []; private $_userDefinedProperties = []; private static $_doNotTakeOverProperties = [ '_defaultValues' => true, '_userDefinedValues' => true, '_userDefinedProperties' => true, ]; final public function __construct() { // take over all user-defined non-static properties foreach ((new \ReflectionObject($this))->getProperties() as $property) { $propertyName = $property->getName(); if (isset(self::$_doNotTakeOverProperties[$propertyName]) || $property->isStatic()) { continue; } $this->_userDefinedProperties[$propertyName] = true; $this->_defaultValues[$propertyName] = $property->getValue($this); unset($this->{$property->getName()}); } } final public function __set($name, $value) { if (!isset($this->_userDefinedProperties[$name])) { throw new \LogicException('Unknown property "' . $name . '"'); } if (array_key_exists($name, $this->_userDefinedValues)) { throw new \LogicException('You can not overwrite the value for property "' . $name . '"'); } $this->_userDefinedValues[$name] = $value; } final public function __get($name) { if (!isset($this->_userDefinedProperties[$name])) { throw new \LogicException('Unknown property "' . $name . '"'); } if (array_key_exists($name, $this->_userDefinedValues)) { return $this->_userDefinedValues[$name]; } return $this->_defaultValues[$name]; } } class Foo { use Immutable; public $poo; } $foo = new Foo; $foo->poo = 1; $foo->poo = 2;

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.0170.00316.75
8.3.50.0060.00916.28
8.3.40.0110.00418.82
8.3.30.0000.01818.88
8.3.20.0040.00420.29
8.3.10.0040.00421.90
8.3.00.0080.00021.89
8.2.180.0140.00018.41
8.2.170.0090.00622.96
8.2.160.0060.00820.30
8.2.150.0080.00024.18
8.2.140.0050.00224.66
8.2.130.0040.00420.87
8.2.120.0050.00326.35
8.2.110.0030.00619.32
8.2.100.0080.00418.05
8.2.90.0040.00419.20
8.2.80.0060.00317.97
8.2.70.0060.00317.50
8.2.60.0000.00818.16
8.2.50.0000.00818.09
8.2.40.0040.00420.42
8.2.30.0000.00719.52
8.2.20.0000.00817.77
8.2.10.0070.00018.05
8.2.00.0000.00718.20
8.1.280.0120.00625.92
8.1.270.0040.01522.22
8.1.260.0070.00028.09
8.1.250.0040.00428.09
8.1.240.0070.00420.41
8.1.230.0080.00317.82
8.1.220.0040.00417.75
8.1.210.0000.00818.77
8.1.200.0090.00017.23
8.1.190.0000.00817.22
8.1.180.0040.00418.10
8.1.170.0050.00318.60
8.1.160.0000.00820.84
8.1.150.0000.00819.08
8.1.140.0000.00919.55
8.1.130.0070.00017.61
8.1.120.0050.00217.51
8.1.110.0030.00517.48
8.1.100.0050.00317.50
8.1.90.0000.00717.48
8.1.80.0080.00017.54
8.1.70.0040.00417.49
8.1.60.0030.00517.52
8.1.50.0030.00617.47
8.1.40.0000.00717.48
8.1.30.0030.00617.51
8.1.20.0080.00317.66
8.1.10.0080.00017.64
8.1.00.0000.00817.57
8.0.300.0030.00518.77
8.0.290.0030.00516.75
8.0.280.0040.00418.41
8.0.270.0070.00017.19
8.0.260.0000.00617.26
8.0.250.0070.00017.02
8.0.240.0030.00316.95
8.0.230.0000.00717.00
8.0.220.0030.00517.01
8.0.210.0000.00717.02
8.0.200.0060.00017.06
8.0.190.0000.00817.01
8.0.180.0000.00717.00
8.0.170.0040.00416.95
8.0.160.0000.00816.99
8.0.150.0050.00216.99
8.0.140.0000.00816.99
8.0.130.0030.00313.37
8.0.120.0040.00416.96
8.0.110.0000.00716.95
8.0.100.0040.00416.85
8.0.90.0050.00316.81
8.0.80.0040.01416.98
8.0.70.0000.00717.04
8.0.60.0060.00317.00
8.0.50.0000.00716.94
8.0.30.0120.00417.23
8.0.20.0120.00617.41
8.0.10.0040.00416.99
8.0.00.0080.01016.83
7.4.330.0050.00016.75
7.4.320.0000.00616.62
7.4.300.0040.00416.53
7.4.290.0050.00316.66
7.4.280.0040.00416.63
7.4.270.0000.00816.56
7.4.260.0030.00316.54
7.4.250.0000.00716.49
7.4.240.0000.00716.62
7.4.230.0000.00716.66
7.4.220.0090.00916.49
7.4.210.0070.00916.53
7.4.200.0040.00416.46
7.4.160.0130.00316.48
7.4.150.0070.01717.40
7.4.140.0080.01217.86
7.4.130.0080.01116.55
7.4.120.0180.00416.54
7.4.110.0100.00716.75
7.4.100.0140.00616.38
7.4.90.0140.00716.53
7.4.80.0130.00719.39
7.4.70.0080.00816.57
7.4.60.0070.01016.39
7.4.50.0030.01316.47
7.4.40.0130.01216.49
7.4.30.0140.01116.66
7.4.10.0110.00714.74
7.4.00.0080.01015.13
7.3.330.0000.00613.28
7.3.320.0000.00513.45
7.3.310.0030.00316.49
7.3.300.0030.00316.44
7.3.290.0030.00516.50
7.3.280.0060.01316.42
7.3.270.0160.00017.40
7.3.260.0120.01016.55
7.3.250.0100.00916.53
7.3.240.0100.00916.50
7.3.230.0070.01016.40
7.3.210.0090.00616.64
7.3.200.0080.00819.39
7.3.190.0160.00816.54
7.3.180.0080.00816.46
7.3.170.0110.01116.40
7.3.160.0060.01316.49
7.3.130.0030.01314.92
7.3.120.0080.01014.86
7.3.110.0090.00914.95
7.3.100.0040.00914.99
7.3.90.0040.00914.85
7.3.80.0060.00815.08
7.3.70.0050.00714.77
7.3.60.0040.00814.76
7.3.50.0030.01114.81
7.3.40.0070.00514.90
7.3.30.0060.00614.79
7.3.20.0040.00616.82
7.3.10.0030.01116.69
7.3.00.0030.00916.79
7.2.330.0090.00916.82
7.2.320.0140.00416.48
7.2.310.0030.01916.77
7.2.300.0130.00316.65
7.2.290.0100.00616.61
7.2.260.0040.01515.38
7.2.250.0110.00715.39
7.2.240.0050.00915.16
7.2.230.0020.01015.09
7.2.220.0050.00915.23
7.2.210.0000.01215.13
7.2.200.0090.00415.10
7.2.190.0080.00715.17
7.2.180.0050.00814.96
7.2.170.0090.00515.13
7.2.160.0020.01114.94
7.2.150.0110.00616.96
7.2.140.0030.00916.86
7.2.130.0070.00716.95
7.2.120.0090.00516.99
7.2.110.0080.00616.95
7.2.100.0100.00516.86
7.2.90.0060.00917.07
7.2.80.0060.00716.81
7.2.70.0060.00816.98
7.2.60.0050.00917.08
7.2.50.0060.00816.87
7.2.40.0050.01216.99
7.2.30.0070.00916.97
7.2.20.0050.00916.89
7.2.10.0060.00916.92
7.2.00.0110.00117.75
7.1.330.0100.00515.85
7.1.320.0030.01415.85
7.1.310.0020.01015.87
7.1.300.0030.01015.69
7.1.290.0080.00815.81
7.1.280.0060.00715.72
7.1.270.0050.01015.80
7.1.260.0070.00915.81
7.1.250.0030.01215.94
7.1.240.0100.00315.78
7.1.230.0000.01415.59
7.1.220.0030.00615.72
7.1.210.0030.01015.76
7.1.200.0030.00915.72
7.1.190.0060.01015.96
7.1.180.0100.00315.99
7.1.170.0070.00315.66
7.1.160.0060.01115.86
7.1.150.0040.00715.99
7.1.140.0090.00615.87
7.1.130.0060.00915.81
7.1.120.0080.00415.91
7.1.110.0040.01115.99
7.1.100.0050.00916.90
7.1.90.0060.00315.71
7.1.80.0030.00715.74
7.1.70.0040.00416.47
7.1.60.0060.01317.61
7.1.50.0040.01016.43
7.1.40.0100.00715.86
7.1.30.0040.01115.85
7.1.20.0090.00615.88
7.1.10.0000.01515.43
7.1.00.0020.04618.98
7.0.330.0100.00315.49
7.0.320.0070.00715.55
7.0.310.0030.00715.43
7.0.300.0000.00815.19
7.0.290.0000.01515.56
7.0.280.0000.00815.46
7.0.270.0000.01015.30
7.0.260.0040.00815.37
7.0.250.0000.01215.40
7.0.240.0110.00415.34
7.0.230.0000.01415.52
7.0.220.0030.00815.57
7.0.210.0060.00315.21
7.0.200.0220.00715.20
7.0.190.0030.01315.57
7.0.180.0000.01415.36
7.0.170.0040.01815.34
7.0.160.0050.01115.31
7.0.150.0090.00615.54
7.0.140.0120.00315.51
7.0.130.0000.01115.55
7.0.120.0100.00615.52
7.0.110.0060.00615.26
7.0.100.0000.01315.47
7.0.90.0030.01015.32
7.0.80.0040.00415.42
7.0.70.0000.01015.46
7.0.60.0050.04318.65
7.0.50.0120.02716.57
7.0.40.0070.04016.88
7.0.30.0170.03416.73
7.0.20.0100.02816.76
7.0.10.0100.04716.89
7.0.00.0080.02816.83
5.6.400.0090.00614.80
5.6.390.0110.00314.48
5.6.380.0030.01214.47
5.6.370.0060.00314.64
5.6.360.0060.01014.32
5.6.350.0030.01014.53
5.6.340.0130.00314.57
5.6.330.0070.00714.66
5.6.320.0080.00814.65
5.6.310.0030.01014.70
5.6.300.0080.00814.61
5.6.290.0090.00914.61
5.6.280.0060.03617.74
5.6.270.0060.00914.70
5.6.260.0100.00714.47
5.6.250.0030.01014.31
5.6.240.0030.01414.74
5.6.230.0120.00614.41
5.6.220.0080.00414.46
5.6.210.0040.04117.54
5.6.200.0060.02216.22
5.6.190.0030.02517.62
5.6.180.0130.02517.64
5.6.170.0160.02517.57
5.6.160.0080.05017.58
5.6.150.0060.03716.29
5.6.140.0060.03316.32
5.6.130.0050.04716.29
5.6.120.0140.03617.78
5.6.110.0030.03617.84
5.6.100.0080.04617.86
5.6.90.0090.04017.77
5.6.80.0050.04817.42
5.6.70.0070.00414.50
5.6.60.0040.00814.52
5.6.50.0040.00814.38
5.6.40.0080.00814.56
5.6.30.0030.01014.48
5.6.20.0030.01014.28
5.6.10.0060.00614.48
5.6.00.0120.00314.48
5.5.380.0000.00914.48
5.5.370.0030.00914.60
5.5.360.0040.01214.13
5.5.350.0060.03417.46
5.5.340.0070.03816.21
5.5.330.0040.02617.46
5.5.320.0160.03917.38
5.5.310.0180.03117.38
5.5.300.0060.03016.46
5.5.290.0050.02816.36
5.5.280.0050.02617.79
5.5.270.0080.03117.40
5.5.260.0120.04017.75
5.5.250.0070.02817.48
5.5.240.0070.02417.21
5.5.230.0000.00914.57
5.5.220.0000.01214.34
5.5.210.0030.00814.66
5.5.200.0070.00714.26
5.5.190.0030.01014.49
5.5.180.0090.00914.48
5.5.170.0030.01014.16
5.5.160.0120.00014.36
5.5.150.0070.00714.12
5.5.140.0030.01014.33
5.5.130.0030.01214.63
5.5.120.0030.01014.26
5.5.110.0110.00314.49
5.5.100.0060.00614.02
5.5.90.0000.01314.35
5.5.80.0000.01214.55
5.5.70.0050.00514.29
5.5.60.0060.00914.16
5.5.50.0030.00614.25
5.5.40.0000.01514.59
5.5.30.0030.01014.42
5.5.20.0000.01214.28
5.5.10.0030.01014.36
5.5.00.0060.00314.45

preferences:
47.04 ms | 400 KiB | 5 Q