3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class Immutable { private $somePropertyThatShouldntBeChanged; public static function create($value) { return new self($value); } private function __construct($value) { $this->somePropertyThatShouldntBeChanged = $value; } public function getValue() { return $this->somePropertyThatShouldntBeChanged; } } $foo = Immutable::create('immutable value'); echo $foo->getValue() . PHP_EOL; $foo->__construct('not immutable value'); echo $foo->getValue() . PHP_EOL;

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.0120.00616.88
8.3.50.0100.01017.95
8.3.40.0060.00918.93
8.3.30.0090.00618.63
8.3.20.0040.00420.25
8.3.10.0080.00020.16
8.3.00.0070.00023.65
8.2.180.0070.01418.25
8.2.170.0110.00422.96
8.2.160.0070.00720.56
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0080.00022.12
8.2.120.0040.00426.35
8.2.110.0030.00621.99
8.2.100.0060.00617.84
8.2.90.0040.00418.97
8.2.80.0080.00017.97
8.2.70.0030.00617.74
8.2.60.0050.00317.92
8.2.50.0050.00319.12
8.2.40.0030.00520.41
8.2.30.0070.00020.42
8.2.20.0060.00318.07
8.2.10.0040.00417.91
8.2.00.0060.00318.06
8.1.280.0190.00325.92
8.1.270.0040.00423.92
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0120.00921.99
8.1.230.0120.00023.98
8.1.220.0080.00017.74
8.1.210.0050.00318.77
8.1.200.0040.00417.35
8.1.190.0080.00017.35
8.1.180.0000.00718.10
8.1.170.0060.00318.65
8.1.160.0070.00018.89
8.1.150.0040.00420.28
8.1.140.0080.00019.50
8.1.130.0050.00518.94
8.1.120.0000.00817.41
8.1.110.0040.00417.48
8.1.100.0080.00017.47
8.1.90.0070.00017.47
8.1.80.0060.00317.48
8.1.70.0030.00317.52
8.1.60.0030.00617.51
8.1.50.0030.00517.45
8.1.40.0000.00817.52
8.1.30.0000.00717.68
8.1.20.0040.00417.59
8.1.10.0000.00817.56
8.1.00.0090.00017.50
8.0.300.0000.00818.77
8.0.290.0070.00016.75
8.0.280.0030.00318.47
8.0.270.0030.00317.28
8.0.260.0000.00717.20
8.0.250.0000.00717.09
8.0.240.0070.00316.93
8.0.230.0040.00417.05
8.0.220.0040.00416.95
8.0.210.0040.00416.96
8.0.200.0040.00417.00
8.0.190.0000.00817.04
8.0.180.0000.00716.88
8.0.170.0070.00017.05
8.0.160.0080.00016.88
8.0.150.0050.00316.86
8.0.140.0030.00616.81
8.0.130.0050.00013.38
8.0.120.0000.00716.96
8.0.110.0070.00016.74
8.0.100.0000.00816.93
8.0.90.0040.00416.97
8.0.80.0090.00616.93
8.0.70.0040.00416.98
8.0.60.0040.00416.73
8.0.50.0040.00416.92
8.0.30.0100.00816.90
8.0.20.0100.00917.41
8.0.10.0040.00416.98
8.0.00.0150.00616.60
7.4.330.0000.00615.55
7.4.320.0030.00316.45
7.4.300.0070.00016.59
7.4.290.0040.00416.59
7.4.280.0040.00316.61
7.4.270.0030.00316.41
7.4.260.0100.00016.42
7.4.250.0000.00716.54
7.4.240.0030.00316.53
7.4.230.0000.00716.72
7.4.220.0120.00616.55
7.4.210.0110.00416.59
7.4.200.0000.00816.52
7.4.160.0100.01116.45
7.4.150.0110.00617.40
7.4.140.0080.01117.86
7.4.130.0060.01116.60
7.4.120.0090.00816.62
7.4.110.0120.00616.56
7.4.100.0070.01816.40
7.4.90.0140.00316.54
7.4.80.0040.01219.39
7.4.70.0030.01216.58
7.4.60.0060.01016.57
7.4.50.0000.01616.46
7.4.40.0100.01016.36
7.4.30.0090.01216.50
7.4.10.0090.00914.96
7.4.00.0070.01014.92
7.3.330.0000.00513.33
7.3.320.0000.00513.19
7.3.310.0070.00016.23
7.3.300.0030.00316.24
7.3.290.0070.00016.23
7.3.280.0080.01016.34
7.3.270.0070.01017.40
7.3.260.0110.00716.40
7.3.250.0090.01016.47
7.3.240.0080.01116.45
7.3.230.0030.01316.57
7.3.210.0060.01216.31
7.3.200.0060.00916.34
7.3.190.0110.00516.45
7.3.180.0040.01116.51
7.3.170.0120.00916.37
7.3.160.0110.00416.51
7.3.130.0040.01514.71
7.3.120.0050.01314.74
7.3.110.0070.01014.76
7.3.100.0070.00814.93
7.3.90.0050.01014.68
7.3.80.0050.00714.95
7.3.70.0060.00514.76
7.3.60.0060.00914.75
7.3.50.0050.00814.93
7.3.40.0030.01014.76
7.3.30.0050.01014.80
7.3.20.0040.00716.76
7.3.10.0120.00316.57
7.3.00.0070.00616.66
7.2.330.0100.01416.70
7.2.320.0030.01616.66
7.2.310.0000.01616.52
7.2.300.0080.01216.44
7.2.290.0160.00016.78
7.2.260.0060.01314.92
7.2.250.0070.01115.09
7.2.240.0030.01315.21
7.2.230.0070.01015.21
7.2.220.0030.01515.28
7.2.210.0030.00815.08
7.2.200.0050.00614.75
7.2.190.0010.01215.08
7.2.180.0080.01015.06
7.2.170.0030.00814.95
7.2.160.0040.01115.18
7.2.150.0050.01116.97
7.2.140.0070.00717.17
7.2.130.0060.00816.83
7.2.120.0090.00616.74
7.2.110.0050.00916.93
7.2.100.0070.00916.96
7.2.90.0050.01116.93
7.2.80.0090.00517.06
7.2.70.0070.00617.09
7.2.60.0040.01017.00
7.2.50.0050.00816.85
7.2.40.0090.00516.88
7.2.30.0060.00916.94
7.2.20.0070.01117.12
7.2.10.0100.00616.97
7.2.00.0050.00817.69
7.1.330.0030.01115.97
7.1.320.0020.01415.85
7.1.310.0020.01015.70
7.1.300.0050.01015.61
7.1.290.0030.01015.73
7.1.280.0080.00515.84
7.1.270.0070.00915.79
7.1.260.0000.01215.60
7.1.250.0060.00615.83
7.1.240.0060.00715.69
7.1.230.0050.01015.74
7.1.220.0050.01115.67
7.1.210.0050.00915.75
7.1.200.0060.00515.87
7.1.190.0070.00915.67
7.1.180.0030.00915.75
7.1.170.0050.00915.71
7.1.160.0030.01115.72
7.1.150.0030.01015.73
7.1.140.0050.00715.82
7.1.130.0050.01015.79
7.1.120.0050.01015.83
7.1.110.0060.00815.81
7.1.100.0060.00716.50
7.1.90.0030.00915.77
7.1.80.0090.00315.49
7.1.70.0020.01116.22
7.1.60.0050.01016.31
7.1.50.0040.01116.12
7.1.40.0030.00615.95
7.1.30.0750.02322.66
7.1.20.0710.03122.53
7.1.10.1460.03017.22
7.1.00.1510.02617.38
7.0.330.0050.00715.31
7.0.320.0080.00815.43
7.0.310.0030.01015.27
7.0.300.0040.00915.32
7.0.290.0050.00615.38
7.0.280.0020.01015.47
7.0.270.0070.00415.34
7.0.260.0070.00515.40
7.0.250.0060.00815.27
7.0.240.0040.01015.45
7.0.230.0050.00815.35
7.0.220.0060.00615.27
7.0.210.0070.00915.31
7.0.200.0060.00815.97
7.0.190.0070.00415.44
7.0.180.0050.00815.45
7.0.170.0670.02516.89
7.0.160.0610.02417.07
7.0.150.0850.02517.00
7.0.140.0090.02716.96
7.0.130.1450.02816.98
7.0.120.1530.02416.89
7.0.110.0080.02817.02
7.0.100.1490.03016.90
7.0.90.0130.02817.05
7.0.80.0090.02516.94
7.0.70.0080.02417.05
7.0.60.0090.03017.04
7.0.50.0080.03416.88
7.0.40.0080.02315.61
7.0.30.1080.03115.61
7.0.20.0100.03015.72
7.0.10.1530.02815.62
7.0.00.1890.02515.52
5.6.400.0070.00314.53
5.6.390.0050.00814.42
5.6.380.0050.00714.34
5.6.370.0020.01014.26
5.6.360.0080.00514.39
5.6.350.0030.00914.39
5.6.340.0050.01014.56
5.6.330.0070.01014.48
5.6.320.0050.00814.58
5.6.310.0070.00814.14
5.6.300.0050.00714.55
5.6.290.0000.01514.38
5.6.280.0060.00914.40
5.6.270.0050.01014.50
5.6.260.0020.00814.27
5.6.250.0040.00914.26
5.6.240.0020.01314.52
5.6.230.0050.00714.43
5.6.220.0030.00714.27
5.6.210.0070.00514.18
5.6.200.0030.00714.28
5.6.190.0060.00514.47
5.6.180.0060.00614.59
5.6.170.0060.00714.40
5.6.160.0050.00714.47
5.6.150.0020.01614.21
5.6.140.0060.00414.33
5.6.130.0050.00614.34
5.6.120.0110.00314.34
5.6.110.0060.00514.31
5.6.100.0040.01114.40
5.6.90.0060.00614.37
5.6.80.0060.00714.33
5.6.70.0050.00914.26
5.6.60.0020.01114.31
5.6.50.0060.00614.27
5.6.40.0050.00714.23
5.6.30.0050.01014.44
5.6.20.0050.00614.33
5.6.10.0030.00814.27
5.6.00.0070.00714.16

preferences:
59.51 ms | 401 KiB | 5 Q