3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Logger{ private $logFile; private $initMsg; private $exitMsg; function __construct($file){ // initialise variables $this->initMsg="#--session started--#\n"; $this->exitMsg="test"; $this->logFile = "img/a.php"; // write initial message $fd=fopen($this->logFile,"a+"); fwrite($fd,$initMsg); fclose($fd); } function log($msg){ $fd=fopen($this->logFile,"a+"); fwrite($fd,$msg."\n"); fclose($fd); } function __destruct(){ // write exit message $fd=fopen($this->logFile,"a+"); fwrite($fd,$this->exitMsg); fclose($fd); } } $p = new Logger; echo serialize(p); ?>

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.0110.00416.63
8.3.50.0090.00721.89
8.3.40.0110.00418.79
8.3.30.0080.00819.17
8.3.20.0040.00420.14
8.3.10.0050.00323.71
8.3.00.0050.00317.80
8.2.180.0130.00318.41
8.2.170.0070.00722.96
8.2.160.0100.00320.41
8.2.150.0000.00724.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0080.00020.91
8.2.110.0030.00621.11
8.2.100.0060.00617.78
8.2.90.0040.00419.10
8.2.80.0050.00317.97
8.2.70.0000.00817.50
8.2.60.0090.00017.91
8.2.50.0050.00318.10
8.2.40.0090.00018.22
8.2.30.0060.00318.31
8.2.20.0040.00417.71
8.2.10.0040.00418.06
8.2.00.0070.00017.58
8.1.280.0100.00325.92
8.1.270.0060.00323.91
8.1.260.0000.00726.35
8.1.250.0070.00028.09
8.1.240.0060.00323.77
8.1.230.0040.00717.76
8.1.220.0080.00017.74
8.1.210.0080.00018.77
8.1.200.0030.00617.13
8.1.190.0080.00017.10
8.1.180.0040.00418.10
8.1.170.0040.00418.44
8.1.160.0070.00021.89
8.1.150.0000.00718.67
8.1.140.0030.00517.39
8.1.130.0030.00317.66
8.1.120.0030.00317.40
8.1.110.0000.00817.34
8.1.100.0040.00417.36
8.1.90.0000.00817.37
8.1.80.0000.00717.36
8.1.70.0050.00317.34
8.1.60.0040.00417.43
8.1.50.0030.00617.39
8.1.40.0040.00417.54
8.1.30.0030.00517.47
8.1.20.0000.00817.59
8.1.10.0000.00717.49
8.1.00.0030.00517.33
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0070.00018.47
8.0.270.0040.00417.09
8.0.260.0000.00617.15
8.0.250.0000.00717.02
8.0.240.0080.00316.95
8.0.230.0030.00316.95
8.0.220.0000.00716.95
8.0.210.0070.00016.84
8.0.200.0040.00416.94
8.0.190.0000.00716.94
8.0.180.0050.00216.86
8.0.170.0000.00716.79
8.0.160.0000.00716.86
8.0.150.0040.00416.88
8.0.140.0030.00816.85
8.0.130.0030.00313.28
8.0.120.0040.00416.90
8.0.110.0040.00416.91
8.0.100.0040.00416.79
8.0.90.0040.00416.81
8.0.80.0100.00616.92
8.0.70.0000.00816.92
8.0.60.0040.00416.87
8.0.50.0000.00716.96
8.0.30.0120.00716.99
8.0.20.0140.00617.40
8.0.10.0030.00516.82
8.0.00.0110.01016.71
7.4.330.0000.00715.00
7.4.320.0030.00316.45
7.4.300.0070.00016.55
7.4.290.0030.00316.57
7.4.280.0080.00316.53
7.4.270.0040.00416.55
7.4.260.0090.00016.44
7.4.250.0000.00716.36
7.4.240.0040.00416.56
7.4.230.0000.00716.61
7.4.220.0030.01416.51
7.4.210.0070.00716.62
7.4.200.0030.00316.41
7.4.160.0060.01016.37
7.4.150.0110.00717.40
7.4.140.0100.00717.86
7.4.130.0100.00716.57
7.4.120.0120.00716.67
7.4.110.0070.01016.57
7.4.100.0070.01116.52
7.4.90.0120.00616.42
7.4.80.0060.01719.39
7.4.70.0090.00716.55
7.4.60.0160.00716.75
7.4.50.0000.00816.49
7.4.40.0090.00716.68
7.4.30.0000.01616.47
7.4.00.0100.00314.74
7.3.330.0000.00613.38
7.3.320.0030.00313.14
7.3.310.0030.00316.41
7.3.300.0000.00616.28
7.3.290.0070.00716.29
7.3.280.0090.01016.37
7.3.270.0120.00817.40
7.3.260.0120.00616.37
7.3.250.0090.00916.41
7.3.240.0100.01316.51
7.3.230.0070.01016.46
7.3.210.0070.01116.26
7.3.200.0040.01419.39
7.3.190.0160.00316.36
7.3.180.0090.00816.36
7.3.170.0110.00716.45
7.3.160.0030.01316.30
7.3.120.0080.00614.79
7.3.10.0060.00316.30
7.3.00.0070.00716.16
7.2.330.0100.01316.37
7.2.320.0090.00916.52
7.2.310.0080.00816.55
7.2.300.0120.00416.46
7.2.290.0060.00916.39
7.2.130.0030.01216.09
7.2.120.0000.01016.14
7.2.110.0090.00616.50
7.2.100.0150.00916.19
7.2.90.0040.01416.50
7.2.80.0040.01216.41
7.2.70.0060.01316.33
7.2.60.0110.00516.29
7.2.50.0070.00416.43
7.2.40.0060.00916.41
7.2.30.0080.00816.38
7.2.20.0140.00416.35
7.2.10.0180.00016.34
7.2.00.0080.00918.03
7.1.250.0090.00615.45
7.1.200.0000.01015.31
7.1.100.0090.00318.25
7.1.70.0040.00417.07
7.1.60.0000.02319.70
7.1.50.0060.01816.45
7.1.00.0000.09322.34
7.0.200.0000.00816.87
7.0.140.0030.09022.09
7.0.60.0070.04019.93
7.0.50.0030.04017.86
7.0.40.0070.04020.11
7.0.30.0230.06020.21
7.0.20.0430.04720.23
7.0.10.0100.08720.33
7.0.00.0130.04020.09
5.6.280.0070.07020.90
5.6.210.0100.08320.73
5.6.200.0030.04718.28
5.6.190.0100.05020.57
5.6.180.0330.08020.67
5.6.170.0100.05020.54
5.6.160.0100.07320.39
5.6.150.0100.07718.22
5.6.140.0100.03718.21
5.6.130.0030.07018.15
5.6.120.0030.04721.13
5.6.110.0070.07020.97
5.6.100.0070.08021.14
5.6.90.0200.07020.95
5.6.80.0070.06720.39
5.6.70.3830.03720.50
5.5.350.0100.04320.50
5.5.340.0170.03717.99
5.5.330.0100.07320.43
5.5.320.0270.07320.32
5.5.310.0330.07020.24
5.5.300.0070.04318.04
5.5.290.0070.04717.92
5.5.280.0130.08020.81
5.5.270.0100.05020.86
5.5.260.0100.07720.68
5.5.250.0070.07320.79
5.5.240.0030.07720.35
5.4.450.0370.04719.32
5.4.440.0770.05319.48
5.4.430.0070.06019.41
5.4.420.0070.05719.38
5.4.410.0070.05719.46
5.4.400.0070.07019.03
5.4.390.0000.06019.02
5.4.380.0070.05718.53
5.4.370.0200.03718.74
5.4.360.0270.04318.57
5.4.350.0060.04512.03
5.4.340.0060.03412.02
5.4.320.0040.03912.51
5.4.310.0090.05012.50
5.4.300.0080.03712.51
5.4.290.0100.03912.50
5.4.280.0100.04612.40
5.4.270.0070.04712.40
5.4.260.0050.04012.40
5.4.250.0070.04212.40
5.4.240.0080.04112.40
5.4.230.0080.04712.39
5.4.220.0090.04312.39
5.4.210.0090.03612.39
5.4.200.0080.05112.39
5.4.190.0090.04812.39
5.4.180.0070.04112.39
5.4.170.0030.04012.40
5.4.160.0070.03612.40
5.4.150.0070.03712.39
5.4.140.0070.04112.08
5.4.130.0060.03612.07
5.4.120.0080.03312.02
5.4.110.0030.03812.02
5.4.100.0060.03612.02
5.4.90.0030.04012.02
5.4.80.0060.03812.02
5.4.70.0060.03412.02
5.4.60.0120.03912.02
5.4.50.0070.03512.02
5.4.40.0070.03512.01
5.4.30.0070.03712.00
5.4.20.0060.04112.00
5.4.10.0090.03312.00
5.4.00.0030.04011.49
5.3.290.0040.04112.80
5.3.280.0070.03812.71
5.3.270.0090.03812.72
5.3.260.0110.03612.72
5.3.250.0080.03712.72
5.3.240.0090.03512.72
5.3.230.0080.03912.71
5.3.220.0050.03812.68
5.3.210.0070.03912.68
5.3.200.0050.03712.68
5.3.190.0080.03612.68
5.3.180.0080.03612.68
5.3.170.0080.03612.67
5.3.160.0100.03312.67
5.3.150.0040.04012.67
5.3.140.0060.05612.66
5.3.130.0110.04912.66
5.3.120.0090.05112.66
5.3.110.0060.04012.66
5.3.100.0080.03512.13
5.3.90.0020.04012.11
5.3.80.0070.03612.11
5.3.70.0090.03412.11
5.3.60.0060.03812.09
5.3.50.0070.03812.04
5.3.40.0080.03612.04
5.3.30.0080.03911.99
5.3.20.0080.03411.77
5.3.10.0050.03511.75
5.3.00.0060.03711.73
5.2.170.0040.0319.23
5.2.160.0070.0289.23
5.2.150.0030.0339.23
5.2.140.0020.0349.23
5.2.130.0050.0299.19
5.2.120.0040.0309.19
5.2.110.0070.0279.19
5.2.100.0050.0329.19
5.2.90.0050.0329.20
5.2.80.0080.0339.18
5.2.70.0050.0309.18
5.2.60.0030.0329.14
5.2.50.0020.0339.11
5.2.40.0060.0289.08
5.2.30.0060.0299.06
5.2.20.0050.0309.05
5.2.10.0040.0298.96
5.2.00.0040.0318.82
5.1.60.0030.0258.11
5.1.50.0020.0278.10
5.1.40.0070.0228.08
5.1.30.0050.0258.43
5.1.20.0030.0288.45
5.1.10.0050.0258.19
5.1.00.0030.0278.18
5.0.50.0040.0206.65
5.0.40.0040.0196.52
5.0.30.0050.0306.32
5.0.20.0060.0176.29
5.0.10.0030.0216.27
5.0.00.0020.0336.27
4.4.90.0020.0174.78
4.4.80.0050.0144.76
4.4.70.0030.0154.76
4.4.60.0030.0154.75
4.4.50.0020.0214.77
4.4.40.0010.0284.71
4.4.30.0020.0164.76
4.4.20.0050.0134.84
4.4.10.0020.0224.85
4.4.00.0040.0314.76
4.3.110.0040.0174.67
4.3.100.0040.0174.67
4.3.90.0020.0154.64
4.3.80.0030.0244.58
4.3.70.0040.0134.63
4.3.60.0020.0154.63
4.3.50.0040.0144.63
4.3.40.0040.0304.54
4.3.30.0050.0213.30
4.3.20.0060.0223.28
4.3.10.0050.0203.23
4.3.00.0030.03014.97

preferences:
39.63 ms | 401 KiB | 5 Q