3v4l.org

run code in 300+ PHP versions simultaneously
<? define("DEFAULT_FILE", "textfile.txt"); // Default file that is used when ?file= is not defined. /// END CONFIG, START MAIN SCRIPT // if ($_GET[file] == "") $file = DEFAULT_FILE; else $file = $_GET[file]; if ($_POST[update] == "true") { $fh = fopen($file, 'w') or die("Can't open file."); fwrite($fh, stripslashes($_POST[body])); fclose($fh); } if ($_POST[bsubmit]=="Update") { echo ' <span style="font-weight: bold" > ' ; echo ' ====>>> Read/updated ! <<<==== ' ; echo '</span> ' ; echo '</div> ' ; echo '<div style="text-align: left;"> ' ; } if ($_POST[bsubmit]=="Shopping") { echo ' <span style="font-weight: bold" > ' ; echo ' ====>>> Shopping ! <<<==== ' ; echo '</span> ' ; echo '</div> ' ; define("DEFAULT_FILE", "shopping.txt"); echo '<div style="text-align: left;"> ' ; } if ($_POST[bsubmit]=="Shopping") { echo ' <span style="font-weight: bold" > ' ; echo ' ====>>> To Do List ! <<<==== ' ; echo '</span> ' ; echo '</div> ' ; define("DEFAULT_FILE", "todo.txt"); echo '<div style="text-align: left;"> ' ; } if ($_POST[bsubmit]=="Default") { echo ' <span style="font-weight: bold" > ' ; echo ' ====>>> Textfile List ! <<<==== ' ; echo '</span> ' ; echo '</div> ' ; define("DEFAULT_FILE", "textfile.txt"); echo '<div style="text-align: left;"> ' ; } if ($_POST[bsubmit]=="Reset") { echo ' <span style="font-weight: bold" > ' ; echo ' ====>>> Reset ! <<<==== ' ; echo '</span> ' ; echo '</div> ' ; echo '<div style="text-align: left;"> ' ; $fh = fopen($file, 'w') or die("Can't open file."); fwrite($fh, stripslashes("Reset performed")); fclose($fh); } if ($_POST[bsubmit]=="Save") { $fh = fopen($file, 'w') or die("Can't open file."); fwrite($fh, stripslashes($_POST[body])); fclose($fh); echo ' <span style="font-weight: bold" > ' ; echo ' ====>>> Saved ! <<<==== ' ; echo '</span> ' ; echo '</div> ' ; echo '<div style="text-align: left;"> ' ; } ?> <html><head><title>BCSNotepad</title></head><body> <center><table width=400><tr><td style='border: 2px dashed #003b53; padding:10px; font-family:verdana; font-size:10px; color: #003b53;' align='center'> You are editing: <i><?=$file?></i><br><br> <form action='<?=$PHP_SELF?>?file=<?=$file?>' method='post'> <form action='<?=$PHP_SELF?>?file=<?=$file?>' method='post'> <textarea name='body' rows="25" cols="100" style="font-family: Verdana; padding: 5px; background-color: LightYellow" ><? if (file_exists($file)) readfile($file); else $message = "The file ".$file." does not exist and will<br>be created when you click Save.<br><br>"; ?></textarea><br><br> <?=$message?> <FORM action="notepad.php" method="post"> <INPUT type="submit" name="bsubmit" value="Update"> <INPUT type="submit" name="bsubmit" value="Save"> <INPUT type="submit" name="bsubmit" value="Reset"> </FORM> </form> </td></tr></table></center> </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.60.0070.00716.75
8.3.50.0180.00521.82
8.3.40.0040.01118.80
8.3.30.0130.00618.84
8.3.20.0040.00420.38
8.3.10.0070.00023.51
8.3.00.0080.00019.79
8.2.180.0040.01118.29
8.2.170.0070.00722.96
8.2.160.0070.00720.43
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0080.00319.44
8.2.120.0060.00326.35
8.2.110.0100.00021.92
8.2.100.0040.00817.93
8.2.90.0000.00719.05
8.2.80.0000.00817.97
8.2.70.0040.00417.50
8.2.60.0030.00617.80
8.2.50.0040.00418.07
8.2.40.0000.00822.23
8.2.30.0030.00320.71
8.2.20.0000.00717.74
8.2.10.0080.00018.11
8.2.00.0040.00417.99
8.1.280.0090.00625.92
8.1.270.0050.00320.38
8.1.260.0040.00428.09
8.1.250.0050.00328.09
8.1.240.0030.00622.42
8.1.230.0110.00019.20
8.1.220.0050.00317.74
8.1.210.0050.00318.77
8.1.200.0050.00517.11
8.1.190.0000.00817.00
8.1.180.0000.00918.10
8.1.170.0040.00418.43
8.1.160.0000.00720.53
8.1.150.0050.00218.75
8.1.140.0070.00019.48
8.1.130.0070.00017.46
8.1.120.0000.00817.21
8.1.110.0040.00417.24
8.1.100.0040.00417.20
8.1.90.0070.00017.36
8.1.80.0040.00417.32
8.1.70.0050.00317.32
8.1.60.0040.00417.44
8.1.50.0060.00317.39
8.1.40.0000.00817.37
8.1.30.0080.00017.42
8.1.20.0040.00417.52
8.1.10.0000.00817.46
8.1.00.0040.00417.38
8.0.300.0040.00418.77
8.0.290.0070.00016.63
8.0.280.0000.00718.43
8.0.270.0030.00317.24
8.0.260.0030.00517.14
8.0.250.0060.00016.94
8.0.240.0000.00716.85
8.0.230.0030.00516.92
8.0.220.0040.00416.84
8.0.210.0000.00816.86
8.0.200.0030.00316.91
8.0.190.0050.00216.79
8.0.180.0000.00816.73
8.0.170.0030.00516.77
8.0.160.0060.00316.81
8.0.150.0050.00316.69
8.0.140.0000.00816.68
8.0.130.0000.00513.52
8.0.120.0000.00716.83
8.0.110.0050.00216.68
8.0.100.0050.00216.83
8.0.90.0000.00716.88
8.0.80.0100.00516.83
8.0.70.0050.00316.69
8.0.60.0000.00716.81
8.0.50.0040.00416.65
8.0.30.0100.00616.94
8.0.20.0100.00917.40
8.0.10.0040.00416.99
8.0.00.0100.00916.72
7.4.330.0060.00016.83
7.4.320.0050.00316.44
7.4.300.0000.00616.38
7.4.290.0070.00016.31
7.4.280.0000.00716.46
7.4.270.0000.00716.42
7.4.260.0000.00816.27
7.4.250.0050.00216.34
7.4.240.0000.00716.39
7.4.230.0030.00316.39
7.4.220.0070.01816.39
7.4.210.0050.01216.35
7.4.200.0030.00316.32
7.4.160.0060.01016.42
7.4.150.0130.00617.40
7.4.140.0130.00917.86
7.4.130.0130.00416.47
7.4.120.0070.01116.37
7.4.110.0070.01016.37
7.4.100.0080.01616.48
7.4.90.0120.00616.41
7.4.80.0110.00619.39
7.4.70.0100.00616.68
7.4.60.0100.00716.46
7.4.50.0070.00416.55
7.4.40.0170.00016.50
7.4.30.0150.00316.33
7.4.00.0090.00914.67
7.3.330.0060.00013.26
7.3.320.0050.00313.39
7.3.310.0020.00516.29
7.3.300.0000.00716.22
7.3.290.0000.00716.26
7.3.280.0130.00616.33
7.3.270.0130.00517.40
7.3.260.0060.01016.45
7.3.250.0100.00916.37
7.3.240.0090.00816.47
7.3.230.0100.00716.39
7.3.210.0030.01416.59
7.3.200.0160.00016.28
7.3.190.0030.01316.30
7.3.180.0030.01316.43
7.3.170.0090.00916.35
7.3.160.0080.01216.34
7.2.330.0100.00716.37
7.2.320.0030.01316.50
7.2.310.0030.01316.34
7.2.300.0070.01016.20
7.2.290.0030.01316.60
7.2.80.0160.01016.07
7.2.60.0100.00316.83
7.2.00.0060.00619.33
7.1.200.0080.00415.68
7.1.100.0050.00318.14
7.1.70.0120.00317.09
7.1.60.0120.00919.52
7.1.50.0040.00717.03
7.1.00.0070.07322.45
7.0.200.0000.00716.67
7.0.60.0170.07319.97
7.0.50.0070.08317.91
7.0.40.0100.08720.05
7.0.30.0300.07720.18
7.0.20.0170.07020.04
7.0.10.0000.04720.02
7.0.00.0030.06720.01
5.6.280.0000.03320.94
5.6.210.0070.06720.54
5.6.200.0070.08718.09
5.6.190.0030.08720.41
5.6.180.0230.07720.43
5.6.170.0330.07320.50
5.6.160.0070.06720.55
5.6.150.0030.08318.08
5.6.140.0030.04018.17
5.6.130.0130.07318.07
5.6.120.0070.08020.96
5.6.110.0170.07321.11
5.6.100.0030.04321.02
5.6.90.0130.07720.99
5.6.80.0070.06720.45
5.5.350.0400.06720.46
5.5.340.0070.08317.94
5.5.330.0070.04320.15
5.5.320.0170.06020.27
5.5.310.0230.07720.24
5.5.300.0100.03717.87
5.5.290.0130.06317.92
5.5.280.0070.03720.82
5.5.270.0030.04720.89
5.5.260.0000.06320.66
5.5.250.0170.07320.63
5.5.240.3830.03720.29

preferences:
60.48 ms | 401 KiB | 5 Q