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 { public function __set($property, $value) { throw new CanNotSetProperties; } private function __clone() { throw new CanNotBeCloned; } final private function __construct() { } } final class Test { use Immutable; public function __construct() { echo 'hello'; } public function __clone() { echo 'baba'; } } $test = new Test; $test2 = clone $test;

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.0070.01018.56
8.3.50.0050.01622.02
8.3.40.0120.00318.85
8.3.30.0080.01118.80
8.3.20.0040.00420.20
8.3.10.0040.00421.91
8.3.00.0060.00319.19
8.2.180.0110.00418.41
8.2.170.0120.00922.96
8.2.160.0090.01222.19
8.2.150.0070.00724.18
8.2.140.0150.00024.66
8.2.130.0070.00026.16
8.2.120.0150.00319.77
8.2.110.0060.00320.44
8.2.100.0040.00818.03
8.2.90.0050.00319.23
8.2.80.0050.00317.97
8.2.70.0000.00817.63
8.2.60.0070.00317.92
8.2.50.0000.00818.07
8.2.40.0000.00818.09
8.2.30.0070.00017.93
8.2.20.0040.00417.68
8.2.10.0040.00418.04
8.2.00.0040.00417.73
8.1.280.0140.00725.92
8.1.270.0130.00618.92
8.1.260.0070.00026.35
8.1.250.0080.00028.09
8.1.240.0060.00323.96
8.1.230.0110.00019.16
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0060.00317.35
8.1.190.0000.00817.35
8.1.180.0040.00418.10
8.1.170.0030.00618.66
8.1.160.0000.00722.01
8.1.150.0000.00718.88
8.1.140.0080.00019.17
8.1.130.0030.00517.86
8.1.120.0000.00717.35
8.1.110.0000.00917.46
8.1.100.0000.00717.43
8.1.90.0040.00717.38
8.1.80.0040.00417.46
8.1.70.0030.00317.44
8.1.60.0000.00817.53
8.1.50.0000.00817.41
8.1.40.0050.00217.51
8.1.30.0050.00317.54
8.1.20.0000.00717.64
8.1.10.0040.00417.55
8.1.00.0000.00817.49
8.0.300.0000.00818.77
8.0.290.0000.00716.63
8.0.280.0000.00718.33
8.0.270.0000.00717.21
8.0.260.0000.00817.29
8.0.250.0030.00316.96
8.0.240.0030.00616.96
8.0.230.0030.00516.86
8.0.220.0070.00016.88
8.0.210.0040.00416.76
8.0.200.0000.00616.99
8.0.190.0000.00817.00
8.0.180.0070.00016.80
8.0.170.0040.00416.92
8.0.160.0080.00016.82
8.0.150.0030.00316.89
8.0.140.0040.00416.75
8.0.130.0030.00313.40
8.0.120.0000.00816.90
8.0.110.0000.00716.91
8.0.100.0040.00416.77
8.0.90.0050.00316.80
8.0.80.0030.01916.93
8.0.70.0000.00716.95
8.0.60.0000.00716.90
8.0.50.0000.00716.77
8.0.30.0080.01317.05
8.0.20.0140.01017.40
8.0.10.0040.00416.82
8.0.00.0130.00516.63
7.4.330.0030.00315.03
7.4.320.0030.00316.61
7.4.300.0060.00016.60
7.4.290.0000.00716.45
7.4.280.0040.00416.56
7.4.270.0030.00316.59
7.4.260.0050.00316.55
7.4.250.0000.00716.38
7.4.240.0000.00716.63
7.4.230.0000.00716.52
7.4.220.0110.00616.46
7.4.210.0020.01316.63
7.4.200.0050.00216.70
7.4.160.0100.01016.47
7.4.150.0150.00617.40
7.4.140.0160.00317.86
7.4.130.0060.01016.57
7.4.120.0140.00316.64
7.4.110.0040.01316.41
7.4.100.0030.01516.46
7.4.90.0120.00616.57
7.4.80.0040.01316.50
7.4.70.0070.01016.50
7.4.60.0060.00916.66
7.4.50.0000.00816.16
7.4.40.0100.00716.41
7.4.30.0170.00716.47
7.4.00.0030.01214.88
7.3.330.0020.00213.25
7.3.320.0130.00013.21
7.3.310.0000.00716.25
7.3.300.0040.00416.20
7.3.290.0000.00716.25
7.3.280.0120.00816.27
7.3.270.0130.01017.40
7.3.260.0070.01716.43
7.3.250.0110.01116.43
7.3.240.0090.00916.34
7.3.230.0110.00616.39
7.3.210.0030.01316.41
7.3.200.0130.00719.39
7.3.190.0130.00616.29
7.3.180.0090.00616.42
7.3.170.0070.01016.39
7.3.160.0150.00616.39
7.2.330.0090.01016.68
7.2.320.0140.00716.39
7.2.310.0030.02016.33
7.2.300.0150.01016.66
7.2.290.0070.01016.47
7.2.00.0030.01019.14
7.1.200.0110.00315.49
7.1.100.0000.00818.22
7.1.70.0080.00316.96
7.1.60.0110.01519.46
7.1.50.0070.01416.49
7.1.00.0030.07722.40
7.0.200.0560.00614.68
7.0.140.0030.06722.18
7.0.60.0100.07719.91
7.0.50.0100.03317.87
7.0.40.0130.05020.23
7.0.30.0270.08720.24
7.0.20.0130.04320.30
7.0.10.0000.04720.16
7.0.00.0100.07320.23
5.6.280.0030.07321.10
5.6.210.0130.07320.70
5.6.200.0030.05018.18
5.6.190.0070.04720.58
5.6.180.0500.07320.51
5.6.170.0270.06320.45
5.6.160.0130.07720.54
5.6.150.0100.04718.29
5.6.140.0030.04018.17
5.6.130.0030.04018.28
5.6.120.0030.04720.99
5.6.110.0070.07721.16
5.6.100.0130.07021.02
5.6.90.0070.04721.01
5.6.80.0000.04020.56
5.5.350.0300.06320.44
5.5.340.0030.07317.99
5.5.330.0130.07720.29
5.5.320.0070.08720.31
5.5.310.0370.07020.25
5.5.300.0070.03318.05
5.5.290.0130.07317.96
5.5.280.0070.03720.98
5.5.270.0070.03720.86
5.5.260.0200.07320.79
5.5.250.0070.03720.82
5.5.240.0100.07320.30
5.4.450.0800.06319.61
5.4.440.1300.06319.33
5.4.430.0970.06319.33
5.4.420.1030.05319.46
5.4.410.1100.07019.36
5.4.400.1170.04019.16
5.4.390.0170.05018.80
5.4.380.0100.05718.79
5.4.370.0130.05318.73
5.4.360.0170.05018.77
5.4.350.0200.05018.73
5.4.340.0130.05318.64
5.4.320.0170.05018.60
5.4.310.0170.05018.77
5.4.300.0030.06318.80
5.4.290.0270.04018.64
5.4.280.0130.05318.79
5.4.270.0200.04718.74
5.4.260.0100.05718.77
5.4.250.0170.05018.61
5.4.240.0100.05718.80
5.4.230.0130.05018.59
5.4.220.0100.05718.59
5.4.210.0170.05018.54
5.4.200.0200.04316.65
5.4.190.0130.05718.62
5.4.180.0330.03318.73
5.4.170.0170.05318.82
5.4.160.0100.05318.83
5.4.150.0170.05018.83
5.4.140.0170.04716.24
5.4.130.0070.05316.20
5.4.120.0070.05316.41
5.4.110.0270.03716.25
5.4.100.0200.04716.29
5.4.90.0200.04316.33
5.4.80.0130.04716.23
5.4.70.0030.05716.22
5.4.60.0070.05316.29
5.4.50.0200.04316.41
5.4.40.0170.04716.31
5.4.30.0070.05316.30
5.4.20.0130.05016.18
5.4.10.0170.04316.30
5.4.00.0130.05015.91
5.3.290.0070.06014.73
5.3.280.0100.05714.78
5.3.270.0230.05314.64
5.3.260.0200.06014.77
5.3.250.0130.05714.66
5.3.240.0100.05314.84
5.3.230.0200.04314.83
5.3.220.0100.05714.69
5.3.210.0100.06014.60
5.3.200.0170.05014.65
5.3.190.0130.05314.69
5.3.180.0100.05314.69
5.3.170.0100.06014.65
5.3.160.0130.05014.78
5.3.150.0230.04014.78
5.3.140.0100.05714.63
5.3.130.0130.05314.77
5.3.120.0130.05314.56
5.3.110.0070.06014.59
5.3.100.0100.05314.30
5.3.90.0130.05014.05
5.3.80.0100.05314.14
5.3.70.0130.05014.03
5.3.60.0230.04014.08
5.3.50.0030.06014.17
5.3.40.0100.05314.01
5.3.30.0230.04714.05
5.3.20.0100.05313.88
5.3.10.0070.05313.77
5.3.00.0200.04313.71
5.2.170.0070.04711.19
5.2.160.0030.05011.14
5.2.150.0100.04311.13
5.2.140.0200.03311.15
5.2.130.0170.03311.11
5.2.120.0070.04311.17
5.2.110.0130.03711.14
5.2.100.0100.04011.12
5.2.90.0030.04711.21
5.2.80.0130.04011.18
5.2.70.0100.04311.32
5.2.60.0170.03711.05
5.2.50.0100.04011.16
5.2.40.0170.03011.06
5.2.30.0130.03711.04
5.2.20.0100.03711.03
5.2.10.0130.03311.05
5.2.00.0100.04010.93
5.1.60.0200.02310.03
5.1.50.0070.03710.19
5.1.40.0100.03310.18
5.1.30.0170.02710.33
5.1.20.0100.04010.58
5.1.10.0030.04010.09
5.1.00.0070.03710.12
5.0.50.0130.0338.74
5.0.40.0030.0308.42
5.0.30.0170.0338.25
5.0.20.0000.0338.39
5.0.10.0000.0338.38
5.0.00.0070.0408.19
4.4.90.0070.0205.90
4.4.80.0030.0235.91
4.4.70.0030.0235.85
4.4.60.0030.0305.88
4.4.50.0070.0205.88
4.4.40.0000.0405.89
4.4.30.0030.0235.94
4.4.20.0070.0205.97
4.4.10.0030.0235.96
4.4.00.0000.0375.96
4.3.110.0130.0205.84
4.3.100.0030.0235.84
4.3.90.0030.0235.81
4.3.80.0000.0475.82
4.3.70.0100.0175.82
4.3.60.0100.0175.79
4.3.50.0130.0175.82
4.3.40.0030.0335.75
4.3.30.0000.0234.57
4.3.20.0000.0274.66
4.3.10.0030.0234.58
4.3.00.0070.02714.62

preferences:
60.44 ms | 401 KiB | 5 Q