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('a'); 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.0040.01116.63
8.3.50.0020.01322.05
8.3.40.0150.00018.84
8.3.30.0040.01119.08
8.3.20.0070.00020.34
8.3.10.0040.00423.61
8.3.00.0080.00018.04
8.2.180.0160.00618.18
8.2.170.0080.00522.96
8.2.160.0130.00020.53
8.2.150.0000.00824.18
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0040.00420.95
8.2.110.0040.00421.93
8.2.100.0090.00317.91
8.2.90.0050.00318.82
8.2.80.0030.00617.97
8.2.70.0040.00417.63
8.2.60.0000.00817.92
8.2.50.0030.00618.07
8.2.40.0050.00318.22
8.2.30.0040.00418.37
8.2.20.0040.00417.73
8.2.10.0040.00418.02
8.2.00.0040.00417.63
8.1.280.0100.01025.92
8.1.270.0040.01123.83
8.1.260.0070.00026.35
8.1.250.0030.00328.09
8.1.240.0090.00023.66
8.1.230.0070.00418.97
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0060.00317.35
8.1.190.0040.00417.35
8.1.180.0080.00018.10
8.1.170.0050.00318.37
8.1.160.0000.00721.84
8.1.150.0050.00318.77
8.1.140.0020.00517.37
8.1.130.0000.00717.76
8.1.120.0000.00717.46
8.1.110.0000.00817.41
8.1.100.0070.00017.30
8.1.90.0000.00717.37
8.1.80.0050.00317.31
8.1.70.0000.00817.38
8.1.60.0090.00017.65
8.1.50.0040.00417.57
8.1.40.0070.00017.57
8.1.30.0050.00317.56
8.1.20.0040.00417.55
8.1.10.0000.00717.59
8.1.00.0040.00417.49
8.0.300.0050.00218.77
8.0.290.0000.00816.63
8.0.280.0030.00318.44
8.0.270.0000.00717.19
8.0.260.0000.00617.29
8.0.250.0030.00316.87
8.0.240.0030.00716.86
8.0.230.0000.00716.89
8.0.220.0030.00316.89
8.0.210.0000.00716.84
8.0.200.0070.00017.00
8.0.190.0000.00716.90
8.0.180.0070.00016.77
8.0.170.0020.00516.85
8.0.160.0080.00016.81
8.0.150.0000.00816.82
8.0.140.0080.00416.88
8.0.130.0030.00313.26
8.0.120.0030.00516.92
8.0.110.0040.00416.87
8.0.100.0040.00416.66
8.0.90.0040.00416.96
8.0.80.0070.01416.79
8.0.70.0040.00316.62
8.0.60.0040.00416.89
8.0.50.0000.00716.64
8.0.30.0090.01017.13
8.0.20.0090.01517.40
8.0.10.0050.00316.82
8.0.00.0060.01216.47
7.4.330.0000.00615.00
7.4.320.0040.00416.32
7.4.300.0000.00716.52
7.4.290.0000.00816.54
7.4.280.0030.00516.65
7.4.270.0000.00716.66
7.4.260.0000.01016.44
7.4.250.0030.00316.39
7.4.240.0040.00316.64
7.4.230.0070.00016.64
7.4.220.0060.01216.69
7.4.210.0070.00716.48
7.4.200.0030.00316.72
7.4.160.0110.00616.26
7.4.150.0070.01017.40
7.4.140.0070.00917.86
7.4.130.0040.01216.52
7.4.120.0120.00516.57
7.4.110.0070.01116.52
7.4.100.0130.00416.50
7.4.90.0110.01116.43
7.4.80.0080.01219.39
7.4.70.0050.01016.58
7.4.60.0070.01416.39
7.4.50.0030.00316.45
7.4.40.0120.01016.54
7.4.30.0090.00616.61
7.4.00.0000.01214.93
7.3.330.0050.00013.14
7.3.320.0020.00213.07
7.3.310.0030.00316.21
7.3.300.0030.00316.32
7.3.290.0090.00916.30
7.3.280.0100.00916.33
7.3.270.0160.00017.40
7.3.260.0060.01416.59
7.3.250.0070.01216.27
7.3.240.0100.01016.28
7.3.230.0090.00916.50
7.3.210.0070.01016.45
7.3.200.0090.00919.39
7.3.190.0060.01216.37
7.3.180.0120.00416.62
7.3.170.0090.00616.44
7.3.160.0180.00316.34
7.3.120.0070.01014.98
7.2.330.0070.01316.73
7.2.320.0030.01816.79
7.2.310.0070.01016.52
7.2.300.0100.00616.67
7.2.290.0120.00316.69
7.2.60.0000.01316.89
7.2.50.0030.00416.88
7.1.200.0120.00315.86
7.1.70.0060.00917.09
7.1.60.0070.01319.70
7.1.50.0090.01216.72
7.1.00.0070.07322.40
7.0.200.0040.00416.71
7.0.140.0070.08721.90
7.0.60.2000.08720.02
7.0.50.0130.07317.87
7.0.40.0130.07720.15
7.0.30.0300.06320.22
7.0.20.0330.08020.08
7.0.10.0000.08720.33
7.0.00.0130.03720.25
5.6.280.0100.06721.10
5.6.210.1170.05720.75
5.6.200.0100.03718.19
5.6.190.0130.04720.42
5.6.180.4070.04020.61
5.6.170.0400.06020.39
5.6.160.0070.05720.47
5.6.150.0030.07718.21
5.6.140.0030.04318.26
5.6.130.0070.04718.21
5.6.120.0100.05721.03
5.6.110.0000.05021.14
5.6.100.0100.08721.12
5.6.90.0100.07021.00
5.6.80.0030.04020.41
5.5.350.3430.04020.46
5.5.340.0070.05718.05
5.5.330.0100.07020.21
5.5.320.0400.07320.30
5.5.310.0300.07320.24
5.5.300.0100.06317.98
5.5.290.0030.09018.04
5.5.280.0070.08720.74
5.5.270.0100.05320.85
5.5.260.0100.08020.88
5.5.250.0070.06720.63
5.5.240.0170.07720.20
5.4.450.0500.06319.44
5.4.440.0400.05319.56
5.4.430.0430.06319.54
5.4.420.0230.07019.30
5.4.410.0400.04719.32
5.4.400.0230.06018.99
5.4.390.0330.05719.14
5.4.380.0400.05019.26
5.4.370.0370.05019.18
5.4.360.0430.07319.23
5.4.350.0400.05319.23
5.4.340.0270.06019.16
5.4.320.0400.06719.11
5.4.310.0430.06719.12
5.4.300.0400.07019.18
5.4.290.0430.06319.15
5.4.280.0500.07719.26
5.4.270.0500.06719.01
5.4.260.0430.05019.22
5.4.250.0570.07019.15
5.4.240.0230.06318.97
5.4.230.0470.06319.13
5.4.220.0470.07019.12
5.4.210.0430.06319.25
5.4.200.0500.06719.25
5.4.190.0430.06719.00
5.4.180.0300.07319.13
5.4.170.0230.06019.13
5.4.160.0800.05319.21
5.4.150.0770.06318.93
5.4.140.0530.07016.45
5.4.130.0500.05316.48
5.4.120.0330.06016.57
5.4.110.1000.06716.49
5.4.100.1600.06316.52
5.4.90.1070.05716.48
5.4.80.1170.06316.47
5.4.70.0300.05716.47
5.4.60.1130.07716.51
5.4.50.0970.05316.28
5.4.40.0530.04716.27
5.4.30.0330.05316.38
5.4.20.0300.06316.38
5.4.10.0330.05716.28
5.4.00.0470.05315.95
5.3.290.0330.07314.58
5.3.280.0400.05714.57
5.3.270.0470.07314.56
5.3.260.0630.06314.57
5.3.250.0400.05314.59
5.3.240.0630.07714.59
5.3.230.0530.05014.64
5.3.220.0900.06014.63
5.3.210.0870.07314.56
5.3.200.0970.07014.68
5.3.190.0970.08014.63
5.3.180.1370.07714.55
5.3.170.1070.05714.66
5.3.160.1030.06714.42
5.3.150.1130.05314.64
5.3.140.0370.07014.52
5.3.130.0470.07314.46
5.3.120.0470.06714.61
5.3.110.0400.05714.52
5.3.100.0400.07014.12
5.3.90.0430.04713.98
5.3.80.0370.05014.00
5.3.70.0430.06714.03
5.3.60.0430.04313.93
5.3.50.0470.05013.94
5.3.40.0430.04013.85
5.3.30.0270.06713.90
5.3.20.0300.04713.66
5.3.10.0530.04713.64
5.3.00.0300.05013.55
5.2.170.0270.04711.14
5.2.160.0230.05311.23
5.2.150.0330.03711.13
5.2.140.0330.04311.14
5.2.130.0300.04711.20
5.2.120.0430.03711.20
5.2.110.0230.04311.20
5.2.100.0370.04311.01
5.2.90.0270.04011.09
5.2.80.0370.03311.08
5.2.70.0230.04311.12
5.2.60.0300.04311.04
5.2.50.0370.04310.95
5.2.40.0270.03710.89
5.2.30.0370.03710.96
5.2.20.0270.03710.95
5.2.10.0270.03710.79
5.2.00.0270.04710.83
5.1.60.0230.04010.10
5.1.50.0330.0379.98
5.1.40.0430.0379.86
5.1.30.0200.04010.33
5.1.20.0300.04010.26
5.1.10.0070.04010.12
5.1.00.0070.0409.93
5.0.50.0070.0378.75
5.0.40.0100.0238.75
5.0.30.0070.0478.75
5.0.20.0100.0278.75
5.0.10.0130.0238.75
5.0.00.0070.0508.75
4.4.90.0050.0134.78
4.4.80.0050.0134.75
4.4.70.0030.0154.75
4.4.60.0040.0144.75
4.4.50.0040.0144.77
4.4.40.0040.0244.71
4.4.30.0030.0154.76
4.4.20.0050.0144.85
4.4.10.0030.0154.85
4.4.00.0030.0264.75
4.3.110.0010.0194.67
4.3.100.0030.0154.66
4.3.90.0020.0154.63
4.3.80.0040.0234.58
4.3.70.0030.0144.63
4.3.60.0030.0144.63
4.3.50.0020.0164.63
4.3.40.0040.0224.53
4.3.30.0030.0153.30
4.3.20.0030.0153.28
4.3.10.0040.0143.23
4.3.00.0170.03314.97

preferences:
40.81 ms | 401 KiB | 5 Q