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 private function __construct() { } } 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.40.0030.01318.89
8.3.30.0060.01219.03
8.3.20.0060.00320.32
8.3.10.0100.00621.90
8.3.00.0100.00018.82
8.2.170.0140.00422.96
8.2.160.0160.00322.25
8.2.150.0080.00024.18
8.2.140.0120.00624.66
8.2.130.0070.00026.16
8.2.120.0030.00719.95
8.2.110.0060.00322.10
8.2.100.0040.00718.03
8.2.90.0040.00419.28
8.2.80.0000.00817.97
8.2.70.0090.00017.75
8.2.60.0060.00317.93
8.2.50.0030.00618.07
8.2.40.0040.00419.66
8.2.30.0040.00417.94
8.2.20.0040.00417.64
8.2.10.0000.00817.95
8.2.00.0020.00517.63
8.1.270.0090.00918.93
8.1.260.0040.00426.35
8.1.250.0030.01428.09
8.1.240.0060.00323.88
8.1.230.0040.00819.15
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0030.00717.22
8.1.190.0050.00317.22
8.1.180.0040.00418.10
8.1.170.0000.00818.65
8.1.160.0040.00422.01
8.1.150.0030.00318.81
8.1.140.0000.00819.16
8.1.130.0030.00317.71
8.1.120.0000.00817.50
8.1.110.0000.00717.35
8.1.100.0040.00417.46
8.1.90.0040.00717.36
8.1.80.0030.00317.44
8.1.70.0000.00817.43
8.1.60.0030.00617.43
8.1.50.0000.00817.60
8.1.40.0000.00717.41
8.1.30.0080.00017.66
8.1.20.0030.00617.60
8.1.10.0000.00717.49
8.1.00.0080.00017.52
8.0.300.0000.00818.77
8.0.290.0000.00716.75
8.0.280.0000.00718.50
8.0.270.0020.00517.18
8.0.260.0040.00417.33
8.0.250.0000.00716.97
8.0.240.0040.00416.97
8.0.230.0040.00416.86
8.0.220.0030.00316.89
8.0.210.0030.00316.86
8.0.200.0030.00316.86
8.0.190.0040.00417.01
8.0.180.0000.00716.99
8.0.170.0000.00816.97
8.0.160.0000.00716.82
8.0.150.0070.00016.86
8.0.140.0030.00316.90
8.0.130.0030.00313.30
8.0.120.0040.00416.92
8.0.110.0040.00416.91
8.0.100.0030.00316.81
8.0.90.0000.00716.96
8.0.80.0030.01216.88
8.0.70.0040.00416.94
8.0.60.0040.00416.85
8.0.50.0040.00416.79
8.0.30.0080.01117.13
8.0.20.0110.01317.40
8.0.10.0000.00716.87
8.0.00.0150.00416.85
7.4.330.0030.00315.03
7.4.320.0060.00016.61
7.4.300.0060.00016.57
7.4.290.0000.00716.68
7.4.280.0030.00316.37
7.4.270.0070.00016.58
7.4.260.0090.00016.53
7.4.250.0030.00316.39
7.4.240.0020.00516.49
7.4.230.0070.00016.59
7.4.220.0030.01616.63
7.4.210.0080.00816.52
7.4.200.0000.00716.70
7.4.160.0060.01116.67
7.4.150.0090.00917.40
7.4.140.0100.01017.86
7.4.130.0080.00816.55
7.4.120.0120.00516.54
7.4.110.0100.01316.47
7.4.100.0120.00616.50
7.4.90.0040.01416.40
7.4.80.0150.00916.53
7.4.70.0160.00016.68
7.4.60.0110.00716.46
7.4.50.0000.00716.59
7.4.40.0030.01716.41
7.4.30.0170.00716.46
7.4.00.0080.00814.93
7.3.330.0050.00013.08
7.3.320.0000.01313.13
7.3.310.0060.00016.21
7.3.300.0060.00016.30
7.3.290.0040.00416.13
7.3.280.0110.00716.28
7.3.270.0030.01417.40
7.3.260.0120.00916.52
7.3.250.0170.00216.48
7.3.240.0130.00316.36
7.3.230.0160.00016.40
7.3.210.0070.01416.50
7.3.200.0110.01119.39
7.3.190.0120.00816.38
7.3.180.0150.00016.38
7.3.170.0130.00916.45
7.3.160.0140.00316.23
7.3.120.0100.00614.58
7.3.110.0090.00914.79
7.3.100.0080.00614.93
7.3.90.0060.01014.81
7.3.80.0060.01014.77
7.3.70.0090.00014.86
7.3.60.0040.01114.57
7.3.50.0040.01114.50
7.3.40.0030.00614.82
7.3.30.0070.00714.56
7.3.20.0070.00716.31
7.3.10.0070.00816.45
7.3.00.0070.00516.31
7.2.330.0060.01116.71
7.2.320.0070.01016.73
7.2.310.0020.02216.84
7.2.300.0070.01716.41
7.2.290.0100.00716.81
7.2.250.0100.01015.18
7.2.240.0030.01615.06
7.2.230.0090.00615.25
7.2.220.0100.00714.91
7.2.210.0130.00315.24
7.2.200.0030.00714.91
7.2.190.0070.00714.76
7.2.180.0080.00415.02
7.2.170.0040.00714.97
7.2.130.0090.00516.63
7.2.120.0060.01216.88
7.2.110.0120.00316.63
7.2.100.0050.00916.52
7.2.90.0080.00816.70
7.2.80.0030.01116.78
7.2.70.0060.00716.88
7.2.60.0090.00816.71
7.2.50.0070.00716.64
7.2.40.0110.00516.50
7.2.30.0050.00516.71
7.2.20.0060.01016.71
7.2.10.0000.01016.48
7.2.00.0100.00517.75
7.1.330.0060.00915.87
7.1.320.0060.00615.88
7.1.310.0090.00615.41
7.1.300.0070.00715.46
7.1.290.0110.00315.66
7.1.280.0080.00515.61
7.1.270.0090.00615.60
7.1.260.0030.00715.52
7.1.250.0100.00415.27
7.1.100.0000.00917.98
7.1.70.0000.01117.06
7.1.60.0100.01419.46
7.1.50.0030.01916.47
7.1.00.0000.08022.35
7.0.200.0600.00714.64
7.0.140.0000.06322.08
7.0.60.0030.08020.00
7.0.50.0070.05017.96
7.0.40.0130.03320.24
7.0.30.0330.07320.07
7.0.20.0300.07720.25
7.0.10.0100.07320.24
7.0.00.0170.07320.12
5.6.280.0100.06720.80
5.6.210.0130.07720.50
5.6.200.0030.04018.20
5.6.190.0100.06020.60
5.6.180.0470.06020.63
5.6.170.0230.05020.54
5.6.160.0170.06720.44
5.6.150.0100.07318.19
5.6.140.0030.04018.24
5.6.130.0030.05018.28
5.6.120.0100.07020.99
5.6.110.0070.07721.05
5.6.100.0100.09021.11
5.6.90.0070.07321.14
5.6.80.0100.05720.51
5.5.350.0230.08320.46
5.5.340.0030.09018.08
5.5.330.0030.05320.21
5.5.320.0070.04720.37
5.5.310.0330.08020.32
5.5.300.0030.08717.95
5.5.290.0100.04018.08
5.5.280.0000.07320.79
5.5.270.0130.07720.77
5.5.260.0100.05321.00
5.5.250.0130.05720.57
5.5.240.0170.07020.18
5.4.450.0670.06019.48
5.4.440.1030.05319.70
5.4.430.0730.05719.60
5.4.420.0970.07019.57
5.4.410.1170.04019.06
5.4.400.0700.06019.29
5.4.390.0200.04718.44
5.4.380.0270.04318.61
5.4.370.0230.04718.71
5.4.360.0170.05018.80
5.4.350.0200.04718.75
5.4.340.0170.05318.52
5.4.320.0270.06018.61
5.4.310.0270.04718.80
5.4.300.0200.04718.75
5.4.290.0170.04718.49
5.4.280.0230.04018.61
5.4.270.0100.05718.88
5.4.260.0200.04718.76
5.4.250.0070.06318.57
5.4.240.0230.04318.84
5.4.230.0130.05318.78
5.4.220.0100.05718.51
5.4.210.0130.05318.71
5.4.200.0200.04316.81
5.4.190.0200.04718.79
5.4.180.0200.04718.51
5.4.170.0070.06318.57
5.4.160.0070.05718.75
5.4.150.0070.06018.78
5.4.140.0130.05316.36
5.4.130.0200.04316.29
5.4.120.0200.04316.46
5.4.110.0070.05316.24
5.4.100.0100.05716.26
5.4.90.0100.05316.31
5.4.80.0200.04316.44
5.4.70.0070.05716.29
5.4.60.0100.05316.25
5.4.50.0200.04316.26
5.4.40.0230.04016.24
5.4.30.0170.06016.30
5.4.20.0170.04716.30
5.4.10.0170.04316.21
5.4.00.0170.04315.71
5.3.290.0130.05714.71
5.3.280.0070.05714.68
5.3.270.0170.05014.80
5.3.260.0170.04714.67
5.3.250.0170.04714.79
5.3.240.0130.05014.84
5.3.230.0070.05314.83
5.3.220.0100.05314.60
5.3.210.0230.04714.64
5.3.200.0130.05014.58
5.3.190.0130.05314.71
5.3.180.0070.05714.80
5.3.170.0170.04714.63
5.3.160.0100.05314.61
5.3.150.0100.05714.56
5.3.140.0070.06014.75
5.3.130.0130.07714.77
5.3.120.0200.04714.62
5.3.110.0130.05314.73
5.3.100.0170.04714.16
5.3.90.0170.04714.21
5.3.80.0130.05014.24
5.3.70.0100.05314.08
5.3.60.0270.03714.23
5.3.50.0100.05314.04
5.3.40.0100.05314.01
5.3.30.0170.05013.95
5.3.20.0100.05313.73
5.3.10.0170.04713.67
5.3.00.0170.04313.68
5.2.170.0070.04311.21
5.2.160.0030.04711.29
5.2.150.0130.04011.23
5.2.140.0130.04011.13
5.2.130.0170.03311.22
5.2.120.0130.03711.23
5.2.110.0200.03311.09
5.2.100.0170.03311.19
5.2.90.0070.04311.35
5.2.80.0100.04011.22
5.2.70.0230.03011.14
5.2.60.0070.04711.13
5.2.50.0070.04711.15
5.2.40.0070.04011.04
5.2.30.0130.03711.21
5.2.20.0100.03711.03
5.2.10.0000.05010.89
5.2.00.0130.03710.84
5.1.60.0100.03310.20
5.1.50.0100.03310.20
5.1.40.0100.03310.10
5.1.30.0000.04310.35
5.1.20.0130.05010.42
5.1.10.0130.03310.11
5.1.00.0100.03710.09
5.0.50.0070.0278.59
5.0.40.0030.0308.52
5.0.30.0000.0478.30
5.0.20.0030.0308.22
5.0.10.0070.0278.18
5.0.00.0070.0408.21
4.4.90.0030.0237.58
4.4.80.0170.0137.58
4.4.70.0000.0277.58
4.4.60.0070.0207.58
4.4.50.0130.0137.58
4.4.40.0100.0307.58
4.4.30.0030.0207.58
4.4.20.0030.0237.58
4.4.10.0070.0207.58
4.4.00.0030.0377.58
4.3.110.0030.0237.58
4.3.100.0030.0237.58
4.3.90.0030.0207.58
4.3.80.0030.0377.58
4.3.70.0000.0237.58
4.3.60.0030.0207.58
4.3.50.0070.0207.58
4.3.40.0030.0337.58
4.3.30.0070.0207.58
4.3.20.0000.0237.58
4.3.10.0000.0237.58
4.3.00.0000.02014.62

preferences:
53.56 ms | 400 KiB | 5 Q