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_content($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.60.0130.01017.00
8.3.50.0110.00821.08
8.3.40.0040.01118.96
8.3.30.0090.00619.04
8.3.20.0050.00220.34
8.3.10.0040.00421.75
8.3.00.0070.00317.93
8.2.180.0100.01018.42
8.2.170.0100.01019.02
8.2.160.0110.00722.96
8.2.150.0050.00524.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0080.00021.18
8.2.110.0050.00522.20
8.2.100.0130.00017.78
8.2.90.0090.00017.50
8.2.80.0060.00317.97
8.2.70.0050.00317.93
8.2.60.0000.00817.93
8.2.50.0050.00218.10
8.2.40.0000.00820.59
8.2.30.0000.00717.93
8.2.20.0040.00417.69
8.2.10.0040.00418.03
8.2.00.0040.00418.05
8.1.280.0040.01125.92
8.1.270.0040.00420.38
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0000.00920.70
8.1.230.0080.00319.09
8.1.220.0040.00417.74
8.1.210.0030.00518.77
8.1.200.0030.00617.35
8.1.190.0060.00317.22
8.1.180.0000.00818.10
8.1.170.0060.00318.51
8.1.160.0040.00421.95
8.1.150.0000.00718.84
8.1.140.0040.00417.39
8.1.130.0070.00017.71
8.1.120.0030.00417.37
8.1.110.0000.00717.28
8.1.100.0070.00017.29
8.1.90.0030.00617.47
8.1.80.0000.00717.38
8.1.70.0070.00017.32
8.1.60.0050.00317.53
8.1.50.0070.00317.42
8.1.40.0090.00017.50
8.1.30.0030.00517.72
8.1.20.0000.00817.56
8.1.10.0060.00317.52
8.1.00.0080.00417.46
8.0.300.0000.00819.79
8.0.290.0070.00016.75
8.0.280.0030.00318.50
8.0.270.0000.00717.28
8.0.260.0000.00617.31
8.0.250.0000.00817.00
8.0.240.0030.00617.02
8.0.230.0070.00017.02
8.0.220.0000.00716.99
8.0.210.0000.00716.89
8.0.200.0000.00617.02
8.0.190.0000.00817.00
8.0.180.0000.00716.90
8.0.170.0000.00817.05
8.0.160.0030.00516.88
8.0.150.0000.00717.00
8.0.140.0050.00316.89
8.0.130.0060.00013.42
8.0.120.0040.00416.93
8.0.110.0030.00616.93
8.0.100.0040.00416.90
8.0.90.0050.00216.79
8.0.80.0090.00616.95
8.0.70.0030.00516.81
8.0.60.0000.00716.84
8.0.50.0050.00216.75
8.0.30.0060.01116.90
8.0.20.0090.01017.40
8.0.10.0050.00316.89
8.0.00.0100.00716.71
7.4.330.0060.00015.14
7.4.320.0070.00016.55
7.4.300.0060.00016.46
7.4.290.0030.00316.50
7.4.280.0060.00616.54
7.4.270.0030.00316.50
7.4.260.0030.00316.52
7.4.250.0050.00316.49
7.4.240.0050.00216.56
7.4.230.0070.00016.50
7.4.220.0140.00416.53
7.4.210.0030.01216.49
7.4.200.0000.00716.66
7.4.160.0050.01016.47
7.4.150.0150.00317.40
7.4.140.0120.00917.86
7.4.130.0120.01016.60
7.4.120.0080.01116.52
7.4.110.0060.01616.46
7.4.100.0180.00616.50
7.4.90.0100.00716.63
7.4.80.0140.00619.39
7.4.70.0030.01916.63
7.4.60.0090.00916.59
7.4.50.0000.00816.56
7.4.40.0090.01216.56
7.4.30.0080.01416.73
7.4.00.0130.00314.92
7.3.330.0030.00313.30
7.3.320.0050.00013.29
7.3.310.0000.00816.43
7.3.300.0000.00716.44
7.3.290.0110.00616.44
7.3.280.0100.00916.39
7.3.270.0090.00917.40
7.3.260.0060.01016.61
7.3.250.0120.00616.34
7.3.240.0040.01216.28
7.3.230.0140.00316.39
7.3.210.0070.01016.48
7.3.200.0120.00619.39
7.3.190.0090.00616.42
7.3.180.0060.00916.41
7.3.170.0070.01116.56
7.3.160.0130.00316.43
7.2.330.0060.01116.49
7.2.320.0030.01316.60
7.2.310.0040.01416.75
7.2.300.0090.00716.68
7.2.290.0060.01216.45
7.2.60.0040.01116.95
7.2.00.0030.01019.08
7.1.200.0000.01415.76
7.1.100.0000.01118.04
7.1.70.0060.00617.32
7.1.60.0100.01619.59
7.1.50.0070.01817.00
7.1.00.0070.07322.36
7.0.200.0090.00316.68
7.0.60.0100.08320.04
7.0.50.0100.07717.80
7.0.40.0100.06020.30
7.0.30.0300.05320.30
7.0.20.0270.04020.32
7.0.10.0030.04320.06
7.0.00.0100.06320.25
5.6.210.0100.03320.51
5.6.200.0000.04318.14
5.6.190.0030.04320.58
5.6.180.0270.06320.64
5.6.170.0370.05020.52
5.6.160.0100.03320.47
5.6.150.0100.08018.29
5.6.140.0070.03718.16
5.6.130.0070.08018.15
5.6.120.0070.09021.16
5.6.110.0100.08021.02
5.6.100.0100.08020.98
5.6.90.0100.08320.88
5.6.80.0130.05720.49
5.5.350.0030.06320.33
5.5.340.0070.03717.99
5.5.330.0070.04020.19
5.5.320.0470.07020.50
5.5.310.0270.08720.34
5.5.300.0070.05318.03
5.5.290.0100.05717.98
5.5.280.0000.04320.77
5.5.270.0030.05020.88
5.5.260.0030.07720.89
5.5.250.0200.04720.66
5.5.240.0200.07720.27
5.4.450.0130.06019.31
5.4.440.0930.07019.47
5.4.430.0000.06319.60
5.4.420.0130.07319.23
5.4.410.0130.05019.32
5.4.400.0070.06318.98
5.4.390.0130.05019.08
5.4.380.0000.06318.95
5.4.370.0070.05719.29
5.4.360.0070.05319.18
5.4.350.0030.06019.18
5.4.340.0070.05719.00
5.4.320.0270.03719.16
5.4.310.0170.05019.21
5.4.300.0070.05719.01
5.4.290.0130.04719.30
5.4.280.0130.04719.17
5.4.270.0130.04718.94
5.4.260.0100.06719.23
5.4.250.0170.04719.20
5.4.240.0100.07019.07
5.4.230.0070.05719.29
5.4.220.0200.07019.29
5.4.210.0070.05719.27
5.4.200.0130.04317.02
5.4.190.0070.05719.13
5.4.180.0030.05719.13
5.4.170.0100.05318.90
5.4.160.0070.06019.12
5.4.150.0130.05019.11
5.4.140.0030.05716.32
5.4.130.0100.04716.35
5.4.120.0100.04716.34
5.4.110.0100.04716.25
5.4.100.0170.04316.47
5.4.90.0100.05316.64
5.4.80.0170.04016.23
5.4.70.0130.05016.34
5.4.60.0130.05316.44
5.4.50.0170.04316.57
5.4.40.0130.04716.55
5.4.30.0100.06016.45
5.4.20.0070.05716.34
5.4.10.0030.05316.43
5.4.00.0070.05015.82
5.3.290.0130.05014.58
5.3.280.0230.03714.52
5.3.270.0130.05014.68
5.3.260.0070.06014.66
5.3.250.0200.04314.64
5.3.240.0100.06014.52
5.3.230.0130.05014.46
5.3.220.0070.05714.60
5.3.210.0100.05314.50
5.3.200.0130.04714.68
5.3.190.0100.05314.62
5.3.180.0100.06014.57
5.3.170.0130.04714.57
5.3.160.0130.05014.53
5.3.150.0130.04714.64
5.3.140.0170.04314.61
5.3.130.0130.05014.51
5.3.120.0070.05714.71
5.3.110.0000.06014.52
5.3.100.0000.06013.90
5.3.90.0100.05013.88
5.3.80.0070.05314.04
5.3.70.0130.04714.00
5.3.60.0030.06313.99
5.3.50.0100.04713.92
5.3.40.0170.04013.86
5.3.30.0200.03713.94
5.3.20.0170.04313.69
5.3.10.0030.05313.52
5.3.00.0170.04313.65
5.2.170.0070.04311.12
5.2.160.0070.04011.11
5.2.150.0030.04711.13
5.2.140.0130.03311.27
5.2.130.0030.04311.19
5.2.120.0070.04011.08
5.2.110.0030.04311.23
5.2.100.0100.03711.03
5.2.90.0100.03711.02
5.2.80.0030.04311.11
5.2.70.0000.04710.96
5.2.60.0070.04011.13
5.2.50.0070.04310.93
5.2.40.0130.03310.86
5.2.30.0070.04011.05
5.2.20.0170.03010.97
5.2.10.0170.02710.85
5.2.00.0030.04310.83
5.1.60.0000.0409.93
5.1.50.0070.03310.00
5.1.40.0000.0379.99
5.1.30.0070.03310.51
5.1.20.0070.03710.29
5.1.10.0070.03310.00
5.1.00.0100.0309.92
5.0.50.0100.0238.56
5.0.40.0030.0278.43
5.0.30.0030.0438.23
5.0.20.0030.0278.11
5.0.10.0000.0338.27
5.0.00.0070.0408.32
4.4.90.0030.0275.80
4.4.80.0030.0305.75
4.4.70.0030.0205.80
4.4.60.0100.0135.76
4.4.50.0000.0235.76
4.4.40.0000.0375.74
4.4.30.0070.0205.86
4.4.20.0030.0235.80
4.4.10.0030.0235.82
4.4.00.0030.0335.81
4.3.110.0000.0235.80
4.3.100.0000.0235.67
4.3.90.0000.0235.75
4.3.80.0100.0275.67
4.3.70.0070.0175.64
4.3.60.0070.0175.75
4.3.50.0030.0205.64
4.3.40.0070.0275.61
4.3.30.0030.0204.53
4.3.20.0000.0234.57
4.3.10.0030.0204.51
4.3.00.0030.0207.18

preferences:
33.35 ms | 401 KiB | 5 Q