3v4l.org

run code in 300+ PHP versions simultaneously
<?php //error_reporting(0); //session_start(); function array_to_string($array) { $retval = ''; foreach ($array as $index => $value) { $retval .= urlencode(base64_encode($index)) . '|' . urlencode(base64_encode($value)) . '||'; } return urlencode(substr($retval, 0, -2)); } function string_to_array($string) { $retval = array(); $string = urldecode($string); $tmp_array = explode('||', $string); foreach ($tmp_array as $tmp_val) { list($index, $value) = explode('|', $tmp_val); $retval[base64_decode(urldecode($index))] = base64_decode(urldecode($value)); } return $retval; } function parse_smileys($string) { $smileylist = array(); $i = 0; if ($handle = opendir('./smileys/')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && $file != "Thumbs.db") { $smileylist[$i] = str_replace(".gif", "", $file); $i++; } } closedir($handle); } foreach ($smileylist as $smileycheck) { $string = str_replace(":".$smileycheck.":", "<img src=\"smileys/".$smileycheck.".gif\" />", $string); } return $string; } function is_url($url){ // http, https. ftp $regex = "`^(https?://|ftp://)(([0-9a-z_!~*'().&=+$%-]+:)?[0-9a-z_!~*'().&=+$%-]+@)?" . //user@ "(([0-9]{1,3}\.){3}[0-9]{1,3}" . // IP "|" . // allows either IP or domain "([0-9a-z_!~*'()-]+\.)*" . // tertiary domain(s) "([0-9a-z][0-9a-z-]{0,61})?[0-9a-z]\." . // second level domain "[a-z]{2,6})" . // first level domain "(:[0-9]{1,4})?" . // port number "((/?)|" . // a slash isn't required if there is no file name "(/[0-9a-z_!~*'().;?:@&=+$,%#-]+)+/?)$`"; //filename // www. $regex2 = "`^(www\.)(" . //www. "([0-9a-z_!~*'()-]+\.)*" . // tertiary domain(s) "([0-9a-z][0-9a-z-]{0,61})?[0-9a-z]\." . // second level domain "[a-z]{2,6})" . // first level domain "(:[0-9]{1,4})?" . // port number "((/?)|" . // a slash isn't required if there is no file name "(/[0-9a-z_!~*'().;?:@&=+$,%#-]+)+/?)$`"; //filename return (preg_match($regex, $url) || preg_match($regex2, $url)); } function is_email($email){ $regex = "^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$^"; return preg_match($regex, $email); } function parse_links($msg) { $words = explode(" ", $msg); $new = array(); foreach($words as $word) { if(is_url($word)) if(substr($word,0,4)=="www.") $word = "<a href=\%22http:/%22.$word.%22\%22 target=\"_blank\">[link]</a>"; else $word = "<a href=\"".$word."\" target=\"_blank\">[link]</a>"; if(is_email($word)) $word = "<a href=\"mailto:".$word."\" target=\"_blank\">[mail]</a>"; $new[] = $word; } return implode(" ", $new); } function show(){ include("./config.php"); include("./lang.php"); $lines = file("./db.txt"); $numlines = count($lines); echo'<div class="tagcount">'; if($numlines=="1"){ echo "<center>(".str_replace("%1",$numlines,$lang["numtag"]).""; if($users_online_enabled){ echo ' | '; include("./online.php");} echo ")</center>\n"; } else { echo "<center>(".str_replace("%1",$numlines,$lang["numtags"]).""; if($users_online_enabled){ echo ' | '; include("./online.php");} echo ")</center>\n"; } echo'</div>'; if ($numtags >= $numlines) { $i = 0; } else { $i = $numlines - $numtags; } if($reverse_posts) { $lines = array_reverse($lines); $i = 0; } $ab = 0; while( $i < $numlines ) { if($reverse_posts && ($i > $numtags - 1)) { $i = $numlines + 1; } else { $thistag = string_to_array($lines[$i]); $thistag[4] = parse_smileys($thistag[4]); if(!$thistag[2] || ($thistag[2]=="http://")) { $thistag[2] = "<a href=\"#\">"; } else { $thistag[2] = "<a href=\"".$thistag[2]."\" target=\"_blank\">"; } if($timestamps_enabled&&$thistag[5]) { $timestamp = date($timestamp_format,$thistag[5])." &raquo;"; } else { $timestamp=""; } if($linkparsing) { $message = parse_links(stripslashes($thistag[4])); } else { $message = stripslashes($thistag[4]); } if(!$ab) { echo "<div class=\"taga\"><small>".$timestamp."</small>".$thistag[2]."".stripslashes($thistag[1])."</a> &raquo; ".$message."</div>\n"; $ab = 1; } else { echo "<div class=\"tagb\"><small>".$timestamp."</small>".$thistag[2].stripslashes($thistag[1])."</a> &raquo; ".$message."</div>\n"; $ab = 0; } } $i++; } //######################################################################## if($users_ip_enabled) { echo "<center>".$lang["usersip"]."<span class=\"ip\">".$_SERVER['REMOTE_ADDR']."</span></center>"; } if(!$users_ip_enabled) { echo ""; } if($admin_status_enabled){ //session_start(); if(isset($_SESSION['logged_in']) && $_SESSION['logged_in']==md5(md5($adminpass))) { echo "<center>".$lang["adminstatus"]."<span class=\"admin_online\"> ".$lang["adminonline"]."</span></center>"; }else{ echo "<center>".$lang["adminstatus"]."<span class=\"admin_offline\"> ".$lang["adminoffline"]."</span></center>"; } }else{ if($users_ip_enabled) { echo "</center>"; } } if($powered_by_enabled_bottom){ echo "<center>".$lang["poweredby"]."<a target=\"_blank\" href=".$lang["poweredurl"].">tagBox ".$versie."</a></center>"; } //######################################################################## } function main() { //session_start(); echo '<!DOCTYPE html>'; //echo '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">'."\n"; echo '<html>'."\n"; echo '<head>'."\n"; echo '<title>Tagbox</title>'."\n"; echo '<link rel="stylesheet" type="text/css" href="default.css">'."\n"; echo '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">'."\n"; echo '<script type="text/javascript"> function createRequestObject(){ var request_; var browser = navigator.appName; if(browser == "Microsoft Internet Explorer"){ request_ = new ActiveXObject("Microsoft.XMLHTTP"); }else{ request_ = new XMLHttpRequest(); } return request_; } var http = new Array(); var http2 = new Array(); function getInfo(){ var curDateTime = new Date(); http[curDateTime] = createRequestObject(); http[curDateTime].open(\'get\', \'refresh.php\'); http[curDateTime].onreadystatechange = function(){ if (http[curDateTime].readyState == 4) { if (http[curDateTime].status == 200 || http[curDateTime].status == 304) { var response = http[curDateTime].responseText; document.getElementById(\'view_ajax\').innerHTML = response; } } } http[curDateTime].send(null); } function go(){ window.scrollTo(0,0); getInfo(); window.setTimeout("go()", 5000); } </script>'."\n"; echo '</head>'."\n"; echo '<body onLoad="go()">'."\n"; echo '<center><div id="view_ajax"></div></center>'."\n"; echo '</body>'."\n"; echo '</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.0090.00616.75
8.3.50.0240.01021.99
8.3.40.0060.00918.67
8.3.30.0130.00318.90
8.3.20.0000.00820.16
8.3.10.0000.00823.52
8.3.00.0080.00022.58
8.2.180.0120.00918.16
8.2.170.0080.00822.96
8.2.160.0070.00720.47
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0000.00822.25
8.2.110.0060.00322.26
8.2.100.0140.00017.78
8.2.90.0000.00819.08
8.2.80.0040.00417.97
8.2.70.0060.00317.50
8.2.60.0030.00617.93
8.2.50.0040.00418.07
8.2.40.0080.00019.64
8.2.30.0000.00818.13
8.2.20.0060.00617.65
8.2.10.0030.00517.65
8.2.00.0040.00417.71
8.1.280.0090.00625.92
8.1.270.0000.00823.92
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0060.00323.89
8.1.230.0110.00019.29
8.1.220.0040.00417.74
8.1.210.0050.00318.77
8.1.200.0030.00717.25
8.1.190.0040.00417.53
8.1.180.0050.00318.10
8.1.170.0000.00818.70
8.1.160.0030.00521.96
8.1.150.0040.00418.58
8.1.140.0050.00317.43
8.1.130.0000.00717.87
8.1.120.0000.00717.34
8.1.110.0040.00417.45
8.1.100.0050.00217.48
8.1.90.0000.00717.36
8.1.80.0030.00317.46
8.1.70.0070.00017.34
8.1.60.0040.00417.53
8.1.50.0040.00417.57
8.1.40.0030.00617.40
8.1.30.0000.00817.63
8.1.20.0000.00817.53
8.1.10.0030.00617.53
8.1.00.0000.00817.44
8.0.300.0070.00018.77
8.0.290.0080.00017.18
8.0.280.0000.00818.45
8.0.270.0030.00417.28
8.0.260.0000.00716.71
8.0.250.0000.00716.93
8.0.240.0000.00716.89
8.0.230.0040.00416.85
8.0.220.0070.00016.89
8.0.210.0000.00716.84
8.0.200.0040.00416.86
8.0.190.0040.00416.95
8.0.180.0040.00416.92
8.0.170.0000.00816.88
8.0.160.0050.00216.93
8.0.150.0050.00316.94
8.0.140.0040.00416.82
8.0.130.0030.00313.34
8.0.120.0060.00514.45
8.0.110.0070.00314.46
8.0.100.0070.00414.52
8.0.90.0070.00514.49
8.0.80.0090.00714.51
8.0.70.0090.00214.46
8.0.60.0050.00614.49
8.0.50.0060.00414.47
8.0.30.0090.00815.14
8.0.20.0090.00715.33
8.0.10.0060.00514.56
8.0.00.0080.00415.04
7.4.330.0000.00515.02
7.4.320.0030.00316.54
7.4.300.0030.00316.55
7.4.290.0030.00316.64
7.4.280.0000.00716.45
7.4.270.0070.00016.50
7.4.260.0070.00016.57
7.4.250.0090.00314.35
7.4.240.0090.00114.91
7.4.230.0100.00214.34
7.4.220.0090.00514.40
7.4.210.0060.00815.21
7.4.200.0030.00614.31
7.4.190.0070.00314.47
7.4.180.0060.00613.38
7.4.160.0090.00514.37
7.4.150.0060.00814.68
7.4.140.0100.00415.50
7.4.130.0050.01014.74
7.4.120.0090.00814.76
7.4.110.0060.00814.20
7.4.100.0060.00814.29
7.4.90.0090.00514.25
7.4.80.0120.00415.41
7.4.70.0060.00914.79
7.4.60.0110.00414.75
7.4.50.0110.00214.64
7.4.40.0080.00816.22
7.4.30.0050.00914.67
7.4.20.0070.00714.15
7.4.10.0080.00614.32
7.4.00.0050.00814.51
7.3.330.0050.00013.37
7.3.320.0050.00313.11
7.3.310.0040.00414.26
7.3.300.0030.00614.25
7.3.290.0040.00814.23
7.3.280.0050.01015.05
7.3.270.0090.00414.60
7.3.260.0090.00614.29
7.3.250.0060.00814.72
7.3.240.0070.00414.24
7.3.230.0050.00514.21
7.3.220.0070.00213.15
7.3.210.0070.00414.17
7.3.200.0050.00815.47
7.3.190.0070.00714.67
7.3.180.0050.00814.75
7.3.170.0070.00514.69
7.3.160.0100.00314.75
7.3.150.0070.00514.13
7.3.140.0080.00414.10
7.3.130.0040.00614.31
7.3.120.0080.00414.37
7.3.110.0060.00714.30
7.3.100.0070.00414.25
7.3.90.0070.00314.43
7.3.80.0030.00614.29
7.3.70.0060.00514.22
7.3.60.0020.00914.35
7.3.50.0080.00414.23
7.3.40.0040.00714.31
7.3.30.0040.00814.39
7.3.20.0050.00615.63
7.3.10.0060.00615.64
7.3.00.0100.00515.58
7.2.340.0060.00613.31
7.2.330.0100.00514.40
7.2.320.0060.01014.32
7.2.310.0060.01014.89
7.2.300.0140.00314.82
7.2.290.0090.00714.84
7.2.280.0120.00314.29
7.2.270.0120.00514.22
7.2.260.0060.00914.53
7.2.250.0070.00714.46
7.2.240.0090.00614.36
7.2.230.0060.00714.45
7.2.220.0080.00514.42
7.2.210.0080.00614.29
7.2.200.0120.00314.45
7.2.190.0080.00714.42
7.2.180.0080.00814.52
7.2.170.0080.00614.51
7.2.160.0060.00814.52
7.2.150.0090.00715.80
7.2.140.0070.00715.77
7.2.130.0070.00715.99
7.2.120.0050.01115.81
7.2.110.0090.00515.84
7.2.100.0090.00615.88
7.2.90.0100.00515.82
7.2.80.0080.00715.82
7.2.70.0090.00615.86
7.2.60.0070.00915.89
7.2.50.0040.01215.78
7.2.40.0090.00615.80
7.2.30.0090.00715.97
7.2.20.0070.00915.93
7.2.10.0080.00815.80
7.2.00.0070.00916.57
7.1.330.0050.00914.77
7.1.320.0030.01114.79
7.1.310.0050.00814.77
7.1.300.0080.00614.91
7.1.290.0050.00914.77
7.1.280.0070.00614.78
7.1.270.0060.00714.69
7.1.260.0040.00914.81
7.1.250.0090.00514.70
7.1.240.0070.00614.79
7.1.230.0050.00914.72
7.1.220.0080.00514.85
7.1.210.0070.00514.83
7.1.200.0070.00514.88
7.1.190.0070.00614.72
7.1.180.0090.00614.79
7.1.170.0050.01014.82
7.1.160.0090.00514.73
7.1.150.0060.00914.74
7.1.140.0070.00614.76
7.1.130.0090.00514.70
7.1.120.0100.00514.79
7.1.110.0090.00514.73
7.1.100.0070.00915.42
7.1.90.0090.00614.54
7.1.80.0100.00314.76
7.1.70.0080.00515.10
7.1.60.0080.00915.70
7.1.50.0070.00915.24
7.1.40.0080.00614.78
7.1.30.0080.00514.76
7.1.20.0070.00614.74
7.1.10.0050.00914.64
7.1.00.0070.01916.22
7.0.330.0080.00514.57
7.0.320.0060.00714.54
7.0.310.0070.00714.57
7.0.300.0140.00414.56
7.0.290.0110.00414.52
7.0.280.0070.00614.62
7.0.270.0080.00414.44
7.0.260.0080.00414.56
7.0.250.0100.00414.67
7.0.240.0080.00614.60
7.0.230.0060.00714.63
7.0.220.0070.00714.54
7.0.210.0070.00614.45
7.0.200.0050.00814.97
7.0.190.0060.00714.46
7.0.180.0070.00614.54
7.0.170.0080.00614.54
7.0.160.0080.00614.55
7.0.150.0080.00714.49
7.0.140.0080.01816.07
7.0.130.0080.00614.66
7.0.120.0090.00414.60
7.0.110.0100.00214.66
7.0.100.0090.02015.67
7.0.90.0080.01415.65
7.0.80.0130.02015.55
7.0.70.0110.01615.58
7.0.60.0090.01315.62
7.0.50.0100.02115.61
7.0.40.0070.02115.26
7.0.30.0080.01515.31
7.0.20.0080.01615.19
7.0.10.0090.01715.31
7.0.00.0050.01515.26
5.6.400.0070.00613.79
5.6.390.0080.00613.69
5.6.380.0070.00713.61
5.6.370.0050.00913.72
5.6.360.0050.01013.73
5.6.350.0090.00513.64
5.6.340.0100.00613.73
5.6.330.0080.00713.84
5.6.320.0030.01113.75
5.6.310.0080.00613.60
5.6.300.0060.00913.63
5.6.290.0080.00713.73
5.6.280.0100.01515.16
5.6.270.0070.00713.71
5.6.260.0080.00613.63
5.6.250.0120.01115.04
5.6.240.0070.01615.11
5.6.230.0100.02115.12
5.6.220.0090.01815.13
5.6.210.0080.02015.14
5.6.200.0080.01115.23
5.6.190.0090.01615.25
5.6.180.0080.01215.28
5.6.170.0090.01115.22
5.6.160.0050.02415.24
5.6.150.0090.01615.16
5.6.140.0070.01715.17
5.6.130.0140.01415.12
5.6.120.0110.01215.23
5.6.110.0070.02115.20
5.6.100.0100.01415.17
5.6.90.0090.01815.23
5.6.80.0060.02115.01
5.6.70.0060.02315.10
5.6.60.0090.01915.05
5.6.50.0080.01614.94
5.6.40.0050.02115.03
5.6.30.0050.01715.00
5.6.20.0070.01315.11
5.6.10.0080.01415.02
5.6.00.0070.01415.08
5.5.380.0080.02014.97
5.5.370.0100.01815.06
5.5.360.0100.01314.94
5.5.350.0080.02015.03
5.5.340.0080.02015.10
5.5.330.0080.02115.04
5.5.320.0070.02115.05
5.5.310.0070.01914.95
5.5.300.0090.02214.99
5.5.290.0070.02115.08
5.5.280.0070.01315.10
5.5.270.0060.01515.08
5.5.260.0070.01215.11
5.5.250.0110.01615.08
5.5.240.0060.02214.89
5.5.230.0080.01414.89
5.5.220.0090.01514.87
5.5.210.0110.01615.01
5.5.200.0060.01214.97
5.5.190.0120.01714.83
5.5.180.0090.01414.92
5.5.170.0080.00513.59
5.5.160.0080.01614.81
5.5.150.0090.01914.88
5.5.140.0060.02114.75
5.5.130.0040.01714.70
5.5.120.0090.01914.75
5.5.110.0080.01514.83
5.5.100.0100.01914.88
5.5.90.0040.01714.97
5.5.80.0060.01214.97
5.5.70.0080.01514.91
5.5.60.0070.02014.89
5.5.50.0070.01414.92
5.5.40.0100.01814.88
5.5.30.0080.01614.77
5.5.20.0050.01714.97
5.5.10.0090.01014.82
5.5.00.0070.01314.80
5.4.450.0070.01813.68
5.4.440.0070.01613.68
5.4.430.0070.01113.64
5.4.420.0050.01913.74
5.4.410.0080.01613.66
5.4.400.0070.02113.69
5.4.390.0070.01613.53
5.4.380.0060.01913.60
5.4.370.0090.01013.62
5.4.360.0060.02113.62
5.4.350.0050.01313.61
5.4.340.0100.01013.63
5.4.330.0070.00512.21
5.4.320.0060.01113.55
5.4.310.0070.01813.63
5.4.300.0050.02113.64
5.4.290.0080.02013.56
5.4.280.0050.01613.57
5.4.270.0050.01513.57
5.4.260.0070.00913.60
5.4.250.0070.01713.58
5.4.240.0060.01913.58
5.4.230.0080.01813.51
5.4.220.0100.01113.48
5.4.210.0070.01713.44
5.4.200.0070.01213.50
5.4.190.0090.00913.50
5.4.180.0060.02013.57
5.4.170.0040.01413.51
5.4.160.0080.01113.46
5.4.150.0060.01913.53
5.4.140.0070.01113.04
5.4.130.0080.01113.14
5.4.120.0070.01113.07
5.4.110.0070.01613.07
5.4.100.0060.01313.04
5.4.90.0080.01413.07
5.4.80.0050.01513.16
5.4.70.0050.01513.14
5.4.60.0050.01213.09
5.4.50.0050.01713.02
5.4.40.0060.01913.06
5.4.30.0080.01713.03
5.4.20.0080.01913.08
5.4.10.0060.01613.14
5.4.00.0040.01812.82
5.3.290.0060.02013.06
5.3.280.0080.00912.96
5.3.270.0050.01513.02
5.3.260.0090.01312.99
5.3.250.0070.01212.97
5.3.240.0090.01712.88
5.3.230.0060.01212.95
5.3.220.0030.01412.95
5.3.210.0050.01612.91
5.3.200.0040.02212.87
5.3.190.0070.01912.92
5.3.180.0040.01613.05
5.3.170.0080.01113.02
5.3.160.0060.02113.02
5.3.150.0040.02113.06
5.3.140.0060.02112.97
5.3.130.0060.01912.99
5.3.120.0080.00913.01
5.3.110.0060.02112.96
5.3.100.0070.01912.85
5.3.90.0040.01312.83
5.3.80.0050.01312.84
5.3.70.0040.01312.81
5.3.60.0070.00912.82
5.3.50.0030.01312.79
5.3.40.0050.01812.77
5.3.30.0030.01212.84
5.3.20.0050.01912.77
5.3.10.0070.01012.59
5.3.00.0040.01712.63

preferences:
50.85 ms | 401 KiB | 5 Q