3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class CanNotSetProperties extends RuntimeException { public function __construct() { parent::__construct("You can not set properties on Immutable objects."); } } final class ConstructorIsVisible extends RuntimeException { public function __construct() { parent::__construct("Immutable objects can not expose the constructor."); } } final class CanNotBeCloned extends RuntimeException { public function __construct() { parent::__construct("Immutable objects can not be cloned."); } } trait Immutable { final public function __set($property, $value) { throw new CanNotSetProperties; } final public function __clone() { throw new CanNotBeCloned; } final protected function __construct() { throw new ConstructorIsVisible; } } final class Test { use Immutable; public function __construct() { echo 'hello'; } } $test = new Test; $test->__construct();

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.0140.00316.88
8.3.50.0160.00322.01
8.3.40.0040.01118.63
8.3.30.0100.00318.79
8.3.20.0040.00420.25
8.3.10.0090.00923.66
8.3.00.0060.00319.19
8.2.180.0140.00718.29
8.2.170.0130.00922.96
8.2.160.0060.00922.25
8.2.150.0180.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00419.82
8.2.110.0030.00520.35
8.2.100.0070.00418.22
8.2.90.0040.00419.19
8.2.80.0080.00017.97
8.2.70.0040.00417.50
8.2.60.0060.00317.80
8.2.50.0040.00418.07
8.2.40.0040.00419.94
8.2.30.0000.00717.99
8.2.20.0040.00417.74
8.2.10.0030.00518.09
8.2.00.0040.00417.71
8.1.280.0090.00625.92
8.1.270.0000.00818.86
8.1.260.0110.00726.35
8.1.250.0070.01128.09
8.1.240.0090.00023.89
8.1.230.0080.00419.01
8.1.220.0000.00717.76
8.1.210.0080.00018.77
8.1.200.0090.00017.22
8.1.190.0080.00017.25
8.1.180.0080.00018.10
8.1.170.0050.00318.52
8.1.160.0000.00822.08
8.1.150.0040.00418.96
8.1.140.0040.00419.23
8.1.130.0070.00017.78
8.1.120.0000.00717.38
8.1.110.0000.00717.36
8.1.100.0000.00717.43
8.1.90.0060.00317.45
8.1.80.0000.00717.49
8.1.70.0000.00717.41
8.1.60.0000.00817.54
8.1.50.0030.00517.46
8.1.40.0030.00617.53
8.1.30.0040.00417.62
8.1.20.0040.00417.50
8.1.10.0030.00617.51
8.1.00.0030.00617.51
8.0.300.0070.00018.77
8.0.290.0000.00716.74
8.0.280.0030.00318.50
8.0.270.0000.00717.25
8.0.260.0000.00817.19
8.0.250.0030.00316.95
8.0.240.0040.00416.95
8.0.230.0000.00716.86
8.0.220.0030.00316.90
8.0.210.0030.00316.90
8.0.200.0060.00016.89
8.0.190.0040.00416.99
8.0.180.0000.00716.89
8.0.170.0050.00316.88
8.0.160.0040.00416.87
8.0.150.0040.00416.93
8.0.140.0000.00716.75
8.0.130.0030.00313.33
8.0.120.0000.00816.92
8.0.110.0040.00416.93
8.0.100.0000.00716.70
8.0.90.0040.00416.75
8.0.80.0090.00616.86
8.0.70.0040.00416.83
8.0.60.0050.00216.84
8.0.50.0070.00016.89
8.0.30.0070.01216.96
8.0.20.0100.01517.40
8.0.10.0030.00517.09
8.0.00.0120.00516.75
7.4.330.0000.00615.03
7.4.320.0000.00616.56
7.4.300.0030.00316.52
7.4.290.0030.00316.43
7.4.280.0080.00016.46
7.4.270.0020.00516.60
7.4.260.0060.00316.50
7.4.250.0030.00316.48
7.4.240.0040.00416.48
7.4.230.0000.00716.42
7.4.220.0070.01016.52
7.4.210.0130.00816.54
7.4.200.0030.00316.44
7.4.160.0090.00616.59
7.4.150.0090.00917.40
7.4.140.0100.01017.86
7.4.130.0070.00916.54
7.4.120.0130.00316.54
7.4.110.0140.00316.66
7.4.100.0030.01316.61
7.4.90.0130.00616.50
7.4.80.0110.00816.57
7.4.70.0100.01016.36
7.4.60.0150.00416.41
7.4.50.0000.00816.47
7.4.40.0090.00916.47
7.4.30.0100.01316.46
7.4.00.0080.00615.06
7.3.330.0000.00513.27
7.3.320.0140.00013.05
7.3.310.0000.00716.28
7.3.300.0000.00716.21
7.3.290.0030.00616.21
7.3.280.0100.00716.24
7.3.270.0100.00717.40
7.3.260.0090.00916.18
7.3.250.0120.00516.20
7.3.240.0040.01216.32
7.3.230.0080.00816.39
7.3.210.0100.00616.22
7.3.200.0150.00619.39
7.3.190.0060.01016.26
7.3.180.0140.00716.59
7.3.170.0040.01316.43
7.3.160.0060.01016.52
7.3.120.0070.01314.75
7.3.110.0040.01414.78
7.3.100.0000.01814.85
7.3.90.0070.00714.79
7.3.80.0070.01014.48
7.3.70.0070.00314.64
7.3.60.0090.00914.41
7.3.50.0040.01114.58
7.3.40.0090.00914.64
7.3.30.0030.00914.65
7.3.20.0070.00716.09
7.3.10.0110.00416.61
7.3.00.0030.00916.61
7.2.330.0070.01016.77
7.2.320.0160.00016.78
7.2.310.0100.01016.74
7.2.300.0130.00716.28
7.2.290.0110.00616.65
7.2.250.0090.00614.96
7.2.240.0100.01015.15
7.2.230.0030.01215.09
7.2.220.0080.00414.93
7.2.210.0090.00314.62
7.2.200.0070.00415.13
7.2.190.0030.00615.09
7.2.180.0030.01114.97
7.2.170.0060.00615.00
7.2.00.0030.01319.51
7.1.330.0030.01015.48
7.1.320.0070.00715.57
7.1.310.0090.00315.89
7.1.300.0030.01415.66
7.1.290.0000.01215.74
7.1.280.0060.00615.63
7.1.270.0030.01015.43
7.1.260.0030.01315.50
7.1.100.0090.00417.86
7.1.70.0040.00416.80
7.1.60.0070.01619.46
7.1.50.0100.01016.70
7.1.00.0030.07722.46
7.0.200.0120.00614.75
7.0.140.0070.03021.95
7.0.60.0100.07720.01
7.0.50.0070.03717.87
7.0.40.0100.04020.20
7.0.30.0300.08020.16
7.0.20.0270.03020.19
7.0.10.0070.04320.09
7.0.00.0130.08020.15
5.6.280.0030.07021.13
5.6.210.0070.05320.57
5.6.200.0170.05318.18
5.6.190.0200.03020.77
5.6.180.0570.07020.48
5.6.170.0300.07020.57
5.6.160.0070.08320.55
5.6.150.0100.05018.14
5.6.140.0030.04018.15
5.6.130.0070.03718.21
5.6.120.0030.06321.14
5.6.110.0070.09021.05
5.6.100.0070.08021.00
5.6.90.0070.05021.00
5.6.80.0030.03720.54
5.5.350.0330.07720.43
5.5.340.0070.04018.05
5.5.330.0030.05720.40
5.5.320.0100.08020.25
5.5.310.0230.04020.34
5.5.300.0000.04317.99
5.5.290.0100.08018.05
5.5.280.0030.04020.78
5.5.270.0030.04320.75
5.5.260.0030.08320.98
5.5.250.0070.04020.60
5.5.240.0030.08020.30
5.4.450.0470.07319.60
5.4.440.1030.05319.34
5.4.430.0370.06019.46
5.4.420.0970.05719.54
5.4.410.0870.05319.36
5.4.400.1130.05019.25
5.4.390.0100.05318.77
5.4.380.0230.04318.49
5.4.370.0130.05018.61
5.4.360.0070.05718.61
5.4.350.0130.06318.63
5.4.340.0200.05018.59
5.4.320.0130.05318.78
5.4.310.0170.05318.79
5.4.300.0200.04718.71
5.4.290.0170.05018.52
5.4.280.0130.05318.58
5.4.270.0130.05718.82
5.4.260.0030.06018.48
5.4.250.0130.05318.62
5.4.240.0070.06318.74
5.4.230.0170.04718.60
5.4.220.0170.05318.77
5.4.210.0200.04318.54
5.4.200.0100.05016.53
5.4.190.0070.05718.69
5.4.180.0070.05718.53
5.4.170.0230.06318.78
5.4.160.0170.05018.74
5.4.150.0230.04718.52
5.4.140.0200.04316.46
5.4.130.0100.05016.32
5.4.120.0230.03716.22
5.4.110.0100.05016.46
5.4.100.0200.04316.29
5.4.90.0130.05016.37
5.4.80.0170.04316.34
5.4.70.0200.04316.29
5.4.60.0130.05016.45
5.4.50.0200.04316.32
5.4.40.0200.04316.16
5.4.30.0070.05316.30
5.4.20.0130.05716.17
5.4.10.0200.04316.24
5.4.00.0170.04315.92
5.3.290.0230.06014.89
5.3.280.0100.05314.79
5.3.270.0170.05014.67
5.3.260.0170.05314.67
5.3.250.0130.05014.71
5.3.240.0100.05314.61
5.3.230.0170.05714.59
5.3.220.0070.05714.70
5.3.210.0030.06314.62
5.3.200.0200.04314.75
5.3.190.0130.05014.68
5.3.180.0100.05014.62
5.3.170.0170.04714.76
5.3.160.0100.05314.58
5.3.150.0170.04714.69
5.3.140.0130.05014.62
5.3.130.0100.05714.54
5.3.120.0100.05314.73
5.3.110.0130.05014.55
5.3.100.0170.04714.25
5.3.90.0130.05314.09
5.3.80.0100.05314.11
5.3.70.0130.05014.09
5.3.60.0170.04714.06
5.3.50.0130.05014.09
5.3.40.0100.05014.20
5.3.30.0100.05014.04
5.3.20.0170.04313.93
5.3.10.0130.04713.73
5.3.00.0170.04713.65
5.2.170.0070.04711.18
5.2.160.0100.04011.19
5.2.150.0070.04311.14
5.2.140.0070.04311.28
5.2.130.0200.03011.14
5.2.120.0070.04011.15
5.2.110.0100.04011.21
5.2.100.0100.04011.15
5.2.90.0030.04311.17
5.2.80.0070.04311.16
5.2.70.0100.04011.16
5.2.60.0000.05011.17
5.2.50.0070.04311.06
5.2.40.0130.03711.06
5.2.30.0070.04311.01
5.2.20.0170.03310.97
5.2.10.0100.03710.92
5.2.00.0100.03710.80
5.1.60.0000.04010.11
5.1.50.0000.04310.04
5.1.40.0170.03010.09
5.1.30.0000.04310.41
5.1.20.0070.03710.40
5.1.10.0100.03310.27
5.1.00.0100.03310.17
5.0.50.0100.0238.74
5.0.40.0000.0308.46
5.0.30.0070.0438.34
5.0.20.0030.0308.34
5.0.10.0030.0308.20
5.0.00.0070.0408.27
4.4.90.0030.0237.55
4.4.80.0030.0237.55
4.4.70.0030.0237.55
4.4.60.0070.0207.55
4.4.50.0070.0207.55
4.4.40.0030.0377.55
4.4.30.0030.0237.55
4.4.20.0000.0277.55
4.4.10.0130.0137.55
4.4.00.0070.0337.55
4.3.110.0070.0207.55
4.3.100.0030.0207.55
4.3.90.0030.0207.55
4.3.80.0030.0377.55
4.3.70.0000.0277.55
4.3.60.0070.0177.55
4.3.50.0070.0207.55
4.3.40.0000.0377.55
4.3.30.0000.0237.55
4.3.20.0070.0177.55
4.3.10.0030.0207.55
4.3.00.0230.01314.62

preferences:
50.04 ms | 401 KiB | 5 Q