3v4l.org

run code in 300+ PHP versions simultaneously
<html> <head> <title>Write to a text file</title> </head> <body> <h1>Adding a text block to a text file:</h1> <form action="myfile.php" method='post'> <textarea name='textblock'></textarea> <input type='submit' value='Add text'> </form> <?php // Open the text file $f = fopen("textfile.txt", "w"); // Write text fwrite($f, $_POST["textblock"]); // Close the text file fclose($f); // Open file for reading, and read the line $f = fopen("textfile.txt", "r"); // Read text echo fgets($f); fclose($f); ?> </body> </html>

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.120.0000.01020.66
8.3.110.0110.00820.94
8.3.100.0050.00524.06
8.3.90.0000.00826.77
8.3.80.0090.00018.43
8.3.70.0170.00316.75
8.3.60.0130.01016.75
8.3.50.0020.01722.06
8.3.40.0120.00318.84
8.3.30.0120.00618.55
8.3.20.0080.00020.53
8.3.10.0030.00623.66
8.3.00.0040.00423.36
8.2.240.0060.00316.98
8.2.230.0110.00422.58
8.2.220.0060.00337.54
8.2.210.0080.00026.77
8.2.200.0060.00316.63
8.2.190.0110.01116.63
8.2.180.0080.01516.88
8.2.170.0120.00322.96
8.2.160.0070.00722.26
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0050.00319.77
8.2.120.0040.00426.35
8.2.110.0100.00019.36
8.2.100.0060.00617.93
8.2.90.0080.00019.22
8.2.80.0040.00417.97
8.2.70.0000.00917.63
8.2.60.0000.00817.93
8.2.50.0050.00318.09
8.2.40.0080.00022.29
8.2.30.0030.00518.06
8.2.20.0000.00718.00
8.2.10.0070.00018.12
8.2.00.0000.00717.86
8.1.300.0040.00420.35
8.1.290.0070.00330.84
8.1.280.0030.01425.92
8.1.270.0050.00322.11
8.1.260.0050.00328.09
8.1.250.0000.00828.09
8.1.240.0060.00322.81
8.1.230.0110.00017.46
8.1.220.0030.00617.79
8.1.210.0000.00818.77
8.1.200.0060.00317.35
8.1.190.0000.00817.23
8.1.180.0050.00318.10
8.1.170.0030.00518.59
8.1.160.0040.00418.95
8.1.150.0050.00220.18
8.1.140.0050.00219.48
8.1.130.0030.00317.75
8.1.120.0050.00217.38
8.1.110.0000.00817.50
8.1.100.0070.00017.39
8.1.90.0000.00717.36
8.1.80.0040.00417.50
8.1.70.0000.01017.43
8.1.60.0040.00417.46
8.1.50.0030.00617.58
8.1.40.0030.00617.57
8.1.30.0040.00417.68
8.1.20.0030.00717.64
8.1.10.0000.00817.57
8.1.00.0030.00517.51
8.0.300.0040.00418.77
8.0.290.0070.00016.75
8.0.280.0030.00318.51
8.0.270.0050.00217.32
8.0.260.0030.00517.32
8.0.250.0030.00317.13
8.0.240.0000.00717.00
8.0.230.0000.00817.03
8.0.220.0000.00717.05
8.0.210.0000.00817.07
8.0.200.0030.00317.10
8.0.190.0040.00417.09
8.0.180.0030.00617.03
8.0.170.0000.00817.04
8.0.160.0070.00016.91
8.0.150.0050.00216.95
8.0.140.0040.00416.88
8.0.130.0060.00013.44
8.0.120.0050.00316.98
8.0.110.0000.00716.81
8.0.100.0000.00716.99
8.0.90.0040.00416.84
8.0.80.0090.00617.05
8.0.70.0030.00616.94
8.0.60.0050.00217.01
8.0.50.0000.00716.96
8.0.30.0100.01017.05
8.0.20.0120.01217.40
8.0.10.0040.00416.98
8.0.00.0040.01516.57
7.4.330.0000.00515.55
7.4.320.0000.00916.54
7.4.300.0030.00316.46
7.4.290.0030.00316.50
7.4.280.0040.00416.49
7.4.270.0040.00416.56
7.4.260.0070.00316.39
7.4.250.0000.00716.57
7.4.240.0070.00016.52
7.4.230.0070.00016.27
7.4.220.0040.01516.62
7.4.210.0090.00616.63
7.4.200.0030.00316.45
7.4.160.0090.00716.65
7.4.150.0140.00517.40
7.4.140.0090.00917.86
7.4.130.0060.01216.54
7.4.120.0090.00916.58
7.4.110.0110.00616.61
7.4.100.0100.00716.58
7.4.90.0130.00416.60
7.4.80.0070.01019.39
7.4.70.0090.00916.72
7.4.60.0100.01016.50
7.4.50.0000.01716.43
7.4.40.0100.01016.65
7.4.30.0090.01316.67
7.4.00.0040.01114.89
7.3.330.0050.00013.15
7.3.320.0030.00213.08
7.3.310.0040.00416.18
7.3.300.0070.00016.35
7.3.290.0090.00816.39
7.3.280.0080.01116.34
7.3.270.0060.01417.40
7.3.260.0160.00416.41
7.3.250.0090.00916.36
7.3.240.0100.01116.44
7.3.230.0100.00616.57
7.3.210.0030.01416.38
7.3.200.0130.01016.44
7.3.190.0030.01716.30
7.3.180.0030.01516.36
7.3.170.0160.00616.67
7.3.160.0070.01516.44
7.3.10.0080.00616.66
7.3.00.0060.00616.70
7.2.330.0140.00416.80
7.2.320.0070.01016.65
7.2.310.0120.01416.48
7.2.300.0080.01216.66
7.2.290.0060.01116.71
7.2.130.0070.00516.78
7.2.120.0080.00516.66
7.2.110.0050.01016.92
7.2.100.0070.00617.01
7.2.90.0040.00816.87
7.2.80.0020.01416.88
7.2.70.0020.01316.82
7.2.60.0020.01216.73
7.2.50.0070.00816.87
7.2.40.0090.00716.68
7.2.30.0060.00816.97
7.2.20.0060.00816.84
7.2.10.0070.00516.83
7.2.00.0110.00117.72
7.1.250.0070.00515.69
7.1.70.0040.00417.21
7.1.60.0000.01417.06
7.1.00.0000.08022.52
7.0.200.0000.00816.41
7.0.120.0270.05320.28
7.0.110.0200.06020.23
7.0.100.0270.05020.31
7.0.90.0130.05720.18
7.0.80.0230.07320.38
7.0.70.0170.07020.30
7.0.60.0100.06020.29
7.0.50.0100.06020.27
7.0.40.0070.06320.35
7.0.30.0200.06320.39
7.0.20.0300.07020.22
7.0.10.0170.08020.27
7.0.00.0270.05020.29
5.6.270.0100.07321.04
5.6.260.0100.05720.86
5.6.250.0130.05721.09
5.6.240.0270.04720.75
5.6.230.0130.08320.96
5.6.220.0170.07320.82
5.6.210.0300.06321.01
5.6.200.0100.07320.98
5.6.190.0170.05721.02
5.6.180.0100.07020.94
5.6.170.0170.06320.82
5.6.160.0030.07320.82
5.6.150.0230.06720.84
5.6.140.0170.06721.02
5.6.130.0200.07021.03
5.6.120.0200.06021.02
5.6.110.0070.06720.98
5.6.100.0170.07321.00
5.6.90.0100.06020.82
5.6.80.0130.07020.17
5.6.70.0070.07320.45
5.6.60.0170.05020.19
5.6.50.0130.05720.31
5.6.40.0100.06020.32
5.6.30.0130.07720.10
5.6.20.0200.06320.34
5.6.10.0030.06320.11
5.6.00.0130.06320.37

preferences:
47.39 ms | 403 KiB | 5 Q