3v4l.org

run code in 300+ PHP versions simultaneously
<style> textarea { padding: 10px; margin-top: 5px; width: 3px; height: 150px; width:350px; font-size:15px; border-radius:3px; border:1px solid lightgrey; } textarea:focus { color: red; border:1px solid red; outline:none; } #functions { border:1px solid lightgrey; width:350px; padding-top:5px; padding-bottom:5px; margin:0 auto; border-radius:5px; } #functions:hover { border:1px solid red; } input[type=button] { color:red; padding-left:5px; padding-right:5px; background-color: lightgrey; border:none; border-radius:5px; outline:none; font-size:13px; cursor: pointer; } input[type=button]:active { background-color:darkgrey; } input[type=button]:hover { background-color:red; color:lightgrey; } button { color:white; background-color: red; font-size:15px; border:none; outline:none; border-radius:4px; cursor: pointer; margin-top: 5px; } button:active { font-size:17px; } body { background-color: lightgrey; } #parser { background-color:white; border-radius:5px; text-align: center; width: 350px; margin:0 auto; padding:15px; } #live { background-color:white; border-radius:5px; text-align: center; width: 350px; margin:0 auto; margin-top:20px; padding:15px; font-size:10px; } #output { border:1px solid red; border-radius:5px; width:100%; font-size:14px; padding:5px; } </style> <script> function formatText(tag) { var Field = document.getElementById('comment'); var val = Field.value; var selected_txt = val.substring(Field.selectionStart, Field.selectionEnd); var before_txt = val.substring(0, Field.selectionStart); var after_txt = val.substring(Field.selectionEnd, val.length); Field.value += '[' + tag + ']' + '[/' + tag + ']'; } </script> <body> <div id="parser"> <div id="functions"> <input type="button" value="Bold" onclick="formatText ('b');" /> <input type="button" value="Italic" onclick="formatText ('i');" /> <input type="button" value="Underline" onclick="formatText ('u');" /> <input type="button" value="Code" onclick="formatText ('quote');" /> <input type="button" value="URL" onclick="formatText ('url');" /> <input type="button" value="IMG" onclick="formatText ('img');" /> </div> <form method="post"> <textarea name="comment" id="comment"></textarea> <br> <button>Parse</button> </form> </div> </body> <?php //BBCode Parser function function showBBcodes($text) { // BBcode array $find = array( '~\[b\](.*?)\[/b\]~s', '~\[i\](.*?)\[/i\]~s', '~\[u\](.*?)\[/u\]~s', '~\[quote\](.*?)\[/quote\]~s', '~\[size=(.*?)\](.*?)\[/size\]~s', '~\[color=(.*?)\](.*?)\[/color\]~s', '~\[url\]((?:ftp|https?)://.*?)\[/url\]~s', '~\[img\](https?://.*?\.(?:jpg|jpeg|gif|png|bmp))\[/img\]~s' ); // HTML tags to replace BBcode $replace = array( '<b>$1</b>', '<i>$1</i>', '<span style="text-decoration:underline;">$1</span>', '<pre>$1</'.'pre>', '<span style="font-size:$1px;">$2</span>', '<span style="color:$1;">$2</span>', '<a href="$1">$1</a>', '<img src="$1" alt="" />' ); // Replacing the BBcodes with corresponding HTML tags return preg_replace($find,$replace,$text); } // How to use the above function: if ($_POST){ $bbtext = $_POST['comment']; $htmltext = showBBcodes($bbtext); ?> <div id="live"> <p> Live </p> <div id="output"> <?php echo $htmltext; ?> </div> </div> <?php } ?>

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.0030.01616.50
8.3.50.0140.00718.16
8.3.40.0110.00418.79
8.3.30.0090.00618.71
8.3.20.0110.00018.95
8.3.10.0000.00721.87
8.3.00.0000.00721.90
8.2.180.0090.00916.50
8.2.170.0080.00622.96
8.2.160.0090.00620.39
8.2.150.0070.00024.18
8.2.140.0060.00324.66
8.2.130.0000.00819.28
8.2.120.0000.00826.35
8.2.110.0070.00320.93
8.2.100.0040.00817.72
8.2.90.0060.00617.50
8.2.80.0060.00317.97
8.2.70.0040.00417.90
8.2.60.0040.00417.90
8.2.50.0040.00418.10
8.2.40.0030.00619.20
8.2.30.0040.00420.99
8.2.20.0040.00418.12
8.2.10.0040.00418.00
8.2.00.0040.00417.72
8.1.280.0100.01025.92
8.1.270.0050.00223.99
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0090.00022.23
8.1.230.0070.00422.07
8.1.220.0030.00517.74
8.1.210.0000.00818.77
8.1.200.0090.00017.23
8.1.190.0030.00617.10
8.1.180.0030.00618.10
8.1.170.0040.00418.66
8.1.160.0000.00722.21
8.1.150.0030.00618.82
8.1.140.0040.00419.57
8.1.130.0040.00417.69
8.1.120.0030.00317.46
8.1.110.0000.00817.23
8.1.100.0070.00017.45
8.1.90.0080.00017.41
8.1.80.0040.00417.45
8.1.70.0030.00317.42
8.1.60.0040.00417.52
8.1.50.0030.00517.46
8.1.40.0080.00017.45
8.1.30.0040.00417.58
8.1.20.0000.00817.59
8.1.10.0040.00417.46
8.1.00.0100.00317.25
8.0.300.0000.00719.90
8.0.290.0070.00016.63
8.0.280.0020.00518.39
8.0.270.0030.00617.24
8.0.260.0000.00617.21
8.0.250.0030.00316.79
8.0.240.0030.00316.80
8.0.230.0000.00716.89
8.0.220.0040.00416.84
8.0.210.0000.00616.80
8.0.200.0060.00016.87
8.0.190.0040.00416.96
8.0.180.0000.00716.93
8.0.170.0050.00216.78
8.0.160.0040.00416.85
8.0.150.0000.00716.74
8.0.140.0000.00716.73
8.0.130.0000.00613.27
8.0.120.0000.00816.68
8.0.110.0070.00016.72
8.0.100.0050.00216.71
8.0.90.0080.00016.71
8.0.80.0060.01016.72
8.0.70.0040.00416.90
8.0.60.0070.00016.72
8.0.50.0000.00716.79
8.0.30.0080.01016.97
8.0.20.0110.00817.40
8.0.10.0000.00716.81
8.0.00.0060.01416.96
7.4.330.0060.00015.55
7.4.320.0030.00316.46
7.4.300.0030.00316.31
7.4.290.0000.00716.46
7.4.280.0080.00016.41
7.4.270.0030.00316.54
7.4.260.0030.00316.53
7.4.250.0000.00716.42
7.4.240.0020.00516.51
7.4.230.0030.00316.62
7.4.220.0070.01016.38
7.4.210.0070.00716.52
7.4.200.0030.00416.35
7.4.160.0070.00916.41
7.4.150.0100.00717.40
7.4.140.0110.00817.86
7.4.130.0120.00816.56
7.4.120.0110.00616.38
7.4.110.0070.01016.39
7.4.100.0110.00616.61
7.4.90.0110.00616.37
7.4.80.0040.01219.39
7.4.70.0090.00916.45
7.4.60.0090.00616.51
7.4.50.0100.00316.52
7.4.40.0100.00716.35
7.4.30.0090.00916.46
7.4.10.0100.01014.71
7.4.00.0060.01114.85
7.3.330.0000.00613.03
7.3.320.0030.00313.20
7.3.310.0000.00716.22
7.3.300.0030.00316.15
7.3.290.0000.00716.25
7.3.280.0070.01416.19
7.3.270.0070.01017.40
7.3.260.0130.00916.33
7.3.250.0140.00616.47
7.3.240.0060.01216.40
7.3.230.0060.01216.39
7.3.210.0060.01016.23
7.3.200.0070.01116.39
7.3.190.0080.00816.43
7.3.180.0070.01116.54
7.3.170.0150.00316.30
7.3.160.0060.01016.44
7.3.130.0030.01014.65
7.3.120.0100.00714.77
7.3.110.0120.00614.68
7.3.100.0070.00714.73
7.3.90.0080.00414.72
7.3.80.0040.00814.63
7.3.70.0000.01114.77
7.3.60.0090.00314.46
7.3.50.0030.01414.75
7.3.40.0100.00714.80
7.3.30.0030.01014.49
7.3.20.0030.00616.34
7.3.10.0030.01016.55
7.3.00.0070.00716.56
7.2.330.0140.00316.59
7.2.320.0000.01716.38
7.2.310.0170.00016.45
7.2.300.0100.01016.38
7.2.290.0100.01316.47
7.2.260.0100.01014.89
7.2.250.0090.00914.88
7.2.240.0000.01515.11
7.2.230.0060.01015.16
7.2.220.0070.01014.90
7.2.210.0090.00314.66
7.2.200.0040.00415.14
7.2.190.0030.00914.98
7.2.180.0070.01114.53
7.2.170.0070.00714.99
7.2.160.0000.00914.79
7.2.150.0070.00716.90
7.2.140.0000.00916.86
7.2.130.0040.01116.89
7.2.120.0070.00716.88
7.2.110.0060.00616.45
7.2.100.0040.00816.89
7.2.90.0000.01316.91
7.2.80.0070.00716.94
7.2.70.0100.00717.02
7.2.60.0090.00416.73
7.2.50.0000.01116.50
7.2.40.0030.01416.62
7.2.30.0060.00616.93
7.2.20.0090.00616.51
7.2.10.0040.01116.67
7.2.00.0030.01018.00
7.1.330.0000.01415.56
7.1.320.0090.00615.62
7.1.310.0030.00915.52
7.1.300.0100.00315.74
7.1.290.0030.01015.70
7.1.280.0030.00715.43
7.1.270.0000.01015.47
7.1.260.0040.00915.66
7.1.250.0040.01115.71
7.1.240.0100.00315.81
7.1.230.0130.00015.37
7.1.220.0030.01015.52
7.1.210.0030.01015.43
7.1.200.0020.01115.48
7.1.190.0100.00015.75
7.1.180.0050.00415.27
7.1.170.0050.00515.61
7.1.160.0040.00415.75
7.1.150.0000.00915.66
7.1.140.0060.00915.56
7.1.130.0070.00715.65
7.1.120.0030.01315.65
7.1.110.0030.00815.31
7.1.100.0000.01315.68
7.1.90.0040.01115.65
7.1.80.0000.01115.60
7.1.70.0030.00616.19
7.1.60.0140.00216.46
7.1.50.0070.00715.68
7.1.40.0050.00315.71
7.1.30.0040.00815.32
7.1.20.0030.00915.41
7.1.10.0100.00715.73
7.1.00.0000.04318.95
7.0.330.0000.00915.30
7.0.320.0030.01015.27
7.0.310.0000.01015.06
7.0.300.0070.00715.38
7.0.290.0030.00514.86
7.0.280.0000.01315.47
7.0.270.0040.00715.25
7.0.260.0000.01415.16
7.0.250.0030.00815.27
7.0.240.0040.00715.08
7.0.230.0060.00615.44
7.0.220.0080.00415.28
7.0.210.0030.01015.37
7.0.200.0070.00515.12
7.0.190.0040.00714.83
7.0.180.0000.01215.43
7.0.170.0000.00815.33
7.0.160.0070.01015.05
7.0.150.0100.00315.22
7.0.140.0000.01315.24
7.0.130.0030.01015.14
7.0.120.0100.03017.79
7.0.110.0070.03417.84
7.0.100.0120.03517.72
7.0.90.0230.03217.77
7.0.80.0200.03017.79
7.0.70.0220.03317.80
7.0.60.0200.03417.76
7.0.50.0240.03817.69
7.0.40.0160.03616.78
7.0.30.0200.03616.76
7.0.20.0190.03316.89
7.0.10.0200.04416.90
7.0.00.0160.05016.76
5.6.400.0040.00714.14
5.6.390.0090.00414.22
5.6.380.0060.00614.48
5.6.370.0030.01014.00
5.6.360.0030.01213.92
5.6.350.0060.00914.50
5.6.340.0100.00714.50
5.6.330.0120.00314.17
5.6.320.0070.00714.55
5.6.310.0040.00414.24
5.6.300.0070.01114.58
5.6.290.0060.01014.49
5.6.280.0040.01114.31
5.6.270.0100.03217.62
5.6.260.0090.03417.62
5.6.250.0100.04217.71
5.6.240.0080.03317.63
5.6.230.0050.03717.51
5.6.220.0120.02917.51
5.6.210.0070.03517.63
5.6.200.0100.03717.69
5.6.190.0130.02817.53
5.6.180.0100.04317.73
5.6.170.0070.03917.52
5.6.160.0020.05217.67
5.6.150.0150.03917.55
5.6.140.0120.03317.52
5.6.130.0130.03717.68
5.6.120.0120.04217.61
5.6.110.0100.04617.56
5.6.100.0130.03817.72
5.6.90.0060.04517.66
5.6.80.0150.02517.12
5.6.70.0030.03617.37
5.6.60.0080.03417.13
5.6.50.0030.03417.07
5.6.40.0070.03717.37
5.6.30.0070.03117.26
5.6.20.0100.03617.35
5.6.10.0080.03317.23
5.6.00.0060.04017.11

preferences:
80.51 ms | 400 KiB | 5 Q