3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class Example { private $variable; public function __construct($variable) { $this->variable = fopen('php://memory', 'rw+'); fwrite($this->variable, $variable); } public function example() { return file_get_contents($this->variable); } public function setExample($variable) { fwrite($this->variable, $variable); } public function __destruct() { fclose($this->variable); } } $example = new Example('first'); print $example->example() . PHP_EOL; $example->setExample('second'); print $example->example() . 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.70.0090.00618.68
8.3.60.0090.00616.88
8.3.50.0070.01521.07
8.3.40.0140.00319.00
8.3.30.0080.00619.01
8.3.20.0070.00020.29
8.3.10.0040.00421.76
8.3.00.0070.00317.93
8.2.180.0040.01518.79
8.2.170.0070.01119.01
8.2.160.0110.00322.96
8.2.150.0060.00324.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0080.00020.94
8.2.110.0030.00621.00
8.2.100.0060.00617.91
8.2.90.0030.00719.02
8.2.80.0060.00317.97
8.2.70.0090.00017.63
8.2.60.0050.00317.80
8.2.50.0030.00618.07
8.2.40.0040.00419.75
8.2.30.0000.00717.88
8.2.20.0000.00817.54
8.2.10.0000.00817.88
8.2.00.0070.00017.98
8.1.280.0120.00325.92
8.1.270.0070.00024.66
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0030.00622.80
8.1.230.0030.00717.77
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0090.00317.36
8.1.190.0080.00017.35
8.1.180.0030.00518.10
8.1.170.0050.00318.59
8.1.160.0040.00421.92
8.1.150.0040.00418.95
8.1.140.0000.00917.30
8.1.130.0030.00317.88
8.1.120.0000.00717.30
8.1.110.0040.00417.30
8.1.100.0030.00317.43
8.1.90.0000.00917.41
8.1.80.0070.00017.36
8.1.70.0000.00717.28
8.1.60.0050.00517.47
8.1.50.0030.00617.59
8.1.40.0000.00817.52
8.1.30.0030.00517.74
8.1.20.0000.00817.59
8.1.10.0030.00517.50
8.1.00.0040.00417.48
8.0.300.0000.00918.77
8.0.290.0040.00416.88
8.0.280.0000.00718.46
8.0.270.0000.00717.26
8.0.260.0000.00717.32
8.0.250.0040.00416.95
8.0.240.0080.00017.03
8.0.230.0050.00217.07
8.0.220.0030.00316.85
8.0.210.0050.00216.99
8.0.200.0000.00617.00
8.0.190.0040.00417.03
8.0.180.0040.00416.88
8.0.170.0050.00217.01
8.0.160.0070.00016.87
8.0.150.0030.00316.87
8.0.140.0030.00516.90
8.0.130.0000.00613.43
8.0.120.0080.00016.95
8.0.110.0080.00016.89
8.0.100.0000.00716.92
8.0.90.0040.00416.95
8.0.80.0060.00917.00
8.0.70.0080.00016.98
8.0.60.0070.00016.91
8.0.50.0030.00516.85
8.0.30.0070.01217.21
8.0.20.0090.00917.42
8.0.10.0040.00416.84
8.0.00.0070.01116.71
7.4.330.0020.00215.13
7.4.320.0000.00716.37
7.4.300.0020.00516.47
7.4.290.0020.00516.51
7.4.280.0060.00316.64
7.4.270.0030.00316.43
7.4.260.0050.00316.59
7.4.250.0030.00516.49
7.4.240.0040.00316.55
7.4.230.0070.00016.39
7.4.220.0150.00416.55
7.4.210.0070.00716.60
7.4.200.0030.00416.40
7.4.160.0070.01016.61
7.4.150.0160.00317.40
7.4.140.0090.00817.86
7.4.130.0170.00816.50
7.4.120.0040.01516.51
7.4.110.0060.01616.55
7.4.100.0060.01216.41
7.4.90.0080.01916.44
7.4.80.0130.01019.39
7.4.70.0200.00316.67
7.4.60.0120.00516.47
7.4.50.0030.00516.29
7.4.40.0130.01016.68
7.4.30.0090.00916.55
7.4.00.0040.01414.98
7.3.330.0050.00013.43
7.3.320.0000.00613.25
7.3.310.0000.00716.25
7.3.300.0070.00016.45
7.3.290.0080.00816.41
7.3.280.0080.00816.48
7.3.270.0030.01517.40
7.3.260.0050.01016.41
7.3.240.0070.01016.60
7.3.230.0130.00416.56
7.3.210.0080.00816.32
7.3.200.0100.00719.39
7.3.190.0070.01016.54
7.3.180.0060.01016.18
7.3.170.0050.01116.39
7.3.160.0060.01116.44
7.2.330.0030.01716.59
7.2.320.0100.00616.73
7.2.310.0030.01316.78
7.2.300.0090.00616.60
7.2.290.0100.00716.65
7.1.70.0030.00616.91
7.1.60.0090.01519.59
7.1.50.0070.01716.62
7.1.00.0130.06722.37
7.0.200.0130.00016.46
7.0.60.0170.07320.00
7.0.50.0030.04017.88
7.0.40.0070.09020.20
7.0.30.0630.06720.33
7.0.20.0130.04320.22
7.0.10.0200.04320.15
7.0.00.0070.07320.07
5.6.280.0030.07320.79
5.6.210.0070.08320.65
5.6.200.0070.04718.16
5.6.190.0070.07020.67
5.6.180.0100.05020.55
5.6.170.0270.08020.47
5.6.160.0100.05720.59
5.6.150.0070.04318.19
5.6.140.0070.05718.11
5.6.130.0170.06718.22
5.6.120.0100.03721.00
5.6.110.0000.08720.97
5.6.100.0130.06321.14
5.6.90.0030.09021.00
5.6.80.0000.06320.52
5.6.70.4530.04020.40
5.5.350.0030.04320.29
5.5.340.0100.05018.05
5.5.330.0070.06320.21
5.5.320.0500.06720.29
5.5.310.0230.04720.28
5.5.300.0030.04017.98
5.5.290.0130.07317.92
5.5.280.0070.07720.89
5.5.270.0130.05720.76
5.5.260.0100.08320.77
5.5.250.0130.06720.67
5.5.240.4100.04020.05
5.4.450.0100.06719.47
5.4.440.0930.06319.54
5.4.430.0130.05019.62
5.4.420.0130.05019.66
5.4.410.0130.05019.38
5.4.400.0070.05319.22
5.4.390.0170.04319.17
5.4.380.0230.04019.19
5.4.370.0030.06019.16
5.4.360.0170.04319.14
5.4.350.0070.05719.14
5.4.340.0100.05019.19
5.4.320.0070.05719.01
5.4.310.0100.07019.04
5.4.300.0130.05019.29
5.4.290.0070.05319.16
5.4.280.0100.05319.00
5.4.270.0100.05319.25
5.4.260.0030.05719.02
5.4.250.0070.05719.15
5.4.240.0070.05719.00
5.4.230.0070.05319.11
5.4.220.0030.06319.25
5.4.210.0030.05719.12
5.4.200.0130.04716.97
5.4.190.0130.05019.11
5.4.180.0230.04019.28
5.4.170.0070.05719.00
5.4.160.0070.05718.97
5.4.150.0230.04019.10
5.4.140.0000.06016.45
5.4.130.0100.05016.48
5.4.120.0130.04716.47
5.4.110.0070.05016.47
5.4.100.0030.05716.25
5.4.90.0130.04716.46
5.4.80.0100.04716.56
5.4.70.0000.06016.45
5.4.60.0100.04716.52
5.4.50.0070.05316.32
5.4.40.0000.06016.55
5.4.30.0030.05316.38
5.4.20.0030.05316.44
5.4.10.0130.04716.51
5.4.00.0070.05015.77
5.3.290.0100.05314.82
5.3.280.0030.05714.65
5.3.270.0170.05714.76
5.3.260.0200.04314.62
5.3.250.0100.05014.46
5.3.240.0030.05714.66
5.3.230.0070.05314.68
5.3.220.0030.05314.48
5.3.210.0130.05014.48
5.3.200.0130.04714.55
5.3.190.0170.04714.60
5.3.180.0030.05314.58
5.3.170.0100.04714.50
5.3.160.0170.04314.50
5.3.150.0130.04714.73
5.3.140.0100.05014.46
5.3.130.0100.05014.71
5.3.120.0070.06014.46
5.3.110.0170.04314.46
5.3.100.0170.04314.11
5.3.90.0100.04714.07
5.3.80.0070.05014.17
5.3.70.0100.04713.94
5.3.60.0100.05013.93
5.3.50.0070.05013.94
5.3.40.0100.05013.88
5.3.30.0130.04713.82
5.3.20.0070.05013.67
5.3.10.0070.05013.73
5.3.00.0070.05013.70
5.2.170.0000.04711.16
5.2.160.0070.04011.21
5.2.150.0000.05011.21
5.2.140.0130.05311.14
5.2.130.0000.06311.02
5.2.120.0170.04711.28
5.2.110.0170.03011.08
5.2.100.0130.03311.25
5.2.90.0100.04011.09
5.2.80.0030.04311.18
5.2.70.0030.04711.11
5.2.60.0100.03711.12
5.2.50.0100.03710.96
5.2.40.0130.03310.95
5.2.30.0030.04310.89
5.2.20.0130.03310.87
5.2.10.0070.04010.72
5.2.00.0070.04010.73
5.1.60.0000.04010.05
5.1.50.0030.0379.92
5.1.40.0130.0339.92
5.1.30.0030.04310.34
5.1.20.0070.03710.43
5.1.10.0100.04310.07
5.1.00.0100.04310.08
5.0.50.0000.0338.66
5.0.40.0030.0308.35
5.0.30.0000.0478.39
5.0.20.0030.0278.12
5.0.10.0030.0278.33
5.0.00.0030.0438.01
4.4.90.0000.0235.75
4.4.80.0000.0235.76
4.4.70.0000.0235.77
4.4.60.0030.0205.85
4.4.50.0030.0205.75
4.4.40.0070.0305.82
4.4.30.0000.0235.79
4.4.20.0070.0205.91
4.4.10.0000.0235.83
4.4.00.0000.0375.80
4.3.110.0030.0205.74
4.3.100.0000.0235.70
4.3.90.0070.0175.83
4.3.80.0030.0335.64
4.3.70.0000.0235.68
4.3.60.0030.0205.76
4.3.50.0070.0205.66
4.3.40.0000.0375.75
4.3.30.0000.0234.52
4.3.20.0000.0234.50
4.3.10.0000.0234.52
4.3.00.0000.0237.18

preferences:
66.92 ms | 401 KiB | 5 Q