3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set('display_errors', 'On'); error_reporting(E_ALL); $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $start = $time; session_start(); include 'connect.php'; // Connect to MySQLi $sqli = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME) or die("Error: ".mysqli_error($sqli)); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } //NEWS $limit = 1; $headlinenewsquery = mysqli_query($sqli, "SELECT * FROM news ORDER BY timestamp DESC LIMIT 0, 1") or die("Error: ".mysqli_error($sqli)); $newsquery = mysqli_query($sqli, "SELECT * FROM news ORDER BY timestamp DESC LIMIT 2, 3") or die("Error: ".mysqli_error($sqli)); $headlinenews = array(); while ($row = mysqli_fetch_array($headlinenewsquery)) { $userquery = mysqli_query($sqli, "SELECT * FROM members WHERE id='$uid'") or die("Error: ".mysqli_error($sqli)); $userexists = mysqli_num_rows($query); if ($userexists == 0) { $sender = "<deleted user>"; } else { $userrow = mysqli_fetch_assoc($userquery); $username = $userrow['username']; } $headlinenews[] = array( "id" => $row['id'], "headline" => $row['headline'], "story" => $row['story'], "timestamp" => $row['timestamp'], "username" => $username ); } $news = array(); while ($row = mysqli_fetch_array($newsquery)) { $news[] = array( "id" => $row['id'], "headline" => $row['headline'], "story" => $row['story'], "timestamp" => $row['timestamp'] ); } //FORUMS $limit = 5; $forumquery = mysqli_query($sqli, "SELECT * FROM forumtopics ORDER BY lastpost DESC LIMIT 0, $limit") or die("Error: ".mysqli_error($sqli)); $forumposts = array(); while ($row = mysqli_fetch_array($forumquery)) { $forumposts[] = array( "id" => $row['id'], "threadname" => $row['threadname'], "text" => $row['text'], "lastpost" => $row['lastpost'], "lastpostuserid" => $row['lastpostuserid'] ); } //EVENT $limit = 1; $eventquery = mysqli_query($sqli, "SELECT * FROM events ORDER BY id DESC LIMIT 0, $limit") or die("Error: ".mysqli_error($sqli)); $events = array(); while ($row = mysqli_fetch_array($forumquery)) { $events[] = array( "id" => $row['id'], "name" => $row['name'], "timestamp" => $row['timestamp'] ); } //TOPINFOTEXT $textquery = mysqli_query($sqli, "SELECT * FROM toptext ORDER BY id") or die("Error: ".mysqli_error($sqli)); $textresult = mysqli_fetch_assoc($textquery); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <title>indiehjaerta.com ♥</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <!-- Font's --> <link href='http://fonts.googleapis.com/css?family=Oswald:400,300' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,300,400' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Roboto:300,300italic' rel='stylesheet' type='text/css'> <link href="stylesheet/style.css" rel="stylesheet" type="text/css" /> </head> <body> <script type="text/javascript"> $(function() { $('#TopBarLogin').click(function() { $('#LoginPopUp').show(); return false; }); }); </script> <script type="text/javascript"> $(document).mouseup(function (e) { var container = $("#LoginPopUp"); if (!container.is(e.target) && container.has(e.target).length === 0) { container.hide(); } }); </script> <script type="text/javascript"> $(function() { if (navigator.userAgent.toLowerCase().indexOf("chrome") >= 0) { var intervalId = 0; $(window).load(function() { intervalId = setInterval(function () { // << somehow this does the trick! if ($('input:-webkit-autofill').length > 0) { clearInterval(intervalId); $('input:-webkit-autofill').each(function () { var text = $(this).val(); var name = $(this).attr('name'); $(this).after(this.outerHTML).remove(); $('input[name=' + name + ']').val(text); }); } }, 1); }); } }); </script> <div id="TopBarImageContainer"> <div id="TopBarImage"></div> </div> <div id="MainContent"> <a href="#"> <span class="DivLink"> <div id="TopBarLogin"> <span class="TopBarText">LOGIN <div id="TopBarTriangleDown"></div> </span> </div> </span> </a> <a href="register.php"> <span class="DivLink"> <div id="TopBarCreateAccount"> <span class="TopBarText">CREATE AN ACCOUNT</span> </div> </span> </a> <div id="TopBarUserMenu"> <div id="TopBarUserMenuProfile"> <a href="profile.php"> <span class="TopBarText"> <div id="TopBarUserMenuProfileImage"></div> <span class="DivLink"> PROFILE </span> </span> </a> </div> <div id="TopBarUserMenuMessages"> <a href="messages.php"> <span class="TopBarText"> <div id="TopBarUserMenuMessagesImage"></div> <span class="DivLink"> MESSAGES </span> </span> </a> </div> <div id="TopBarUserMenuSupport"> <a href="support.php"> <span class="TopBarText"> <div id="TopBarUserMenuSupportImage"></div> <span class="DivLink"> SUPPORT </span> </span> </a> </div> </div> <div id="LoginPopUp"> <form method="post" action=""> <input name="username" type="text" id="username" placeholder="Username" style="display: none" /> <input name="password" type="password" id="password" placeholder="Password" style="display: none" /> <input class="LoginInput" name="username" type="text" id="username" placeholder="Username" /><br /> <input class="LoginInput" name="password" type="password" id="password" placeholder="Password" /><br /> <input class="LoginButton" type="submit" name="login" value=""> </form> </div> <div id="LogoMenu"> <div id="SocialTopLinks"> <div id="SocialTopTwitterLink"> <a href="http://www.twitter.com/indiehjaerta"> <span class="DivLink"></span> </a> </div> <div id="SocialTopFacebookLink"> <a href="http://www.facebook.com/indiehjaerta"> <span class="DivLink"></span> </a> </div> <div id="SocialTopYouTubeLink"> <a href="https://www.youtube.com/indiehjaerta"> <span class="DivLink"></span> </a> </div> <div id="SocialTopInstagramLink"> <a href="http://www.instagram.com/indiehjaerta"> <span class="DivLink"></span> </a> </div> <div id="SocialTopTwitchLink"> <a href="http://www.twitch.tv/indiehjaerta"> <span class="DivLink"></span> </a> </div> </div> <div id="TopLogo"> <a href="#"><span class="DivLink"></span></a> </div> <div id="MenuLinkSeparator"></div> <div id="MenuLinks"> <a href="" class="Menu">HOME</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="news.php" class="Menu">ABOUT</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="blog.php" class="Menu">BLOG</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="events.php" class="Menu">EVENTS</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="forums.php" class="Menu">FORUMS</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="" class="Menu">CONTACT</a> </div> </div> <div id="Container"> <div id="InfoHeader"> <span class="TopInfoText"><?php echo $textresult['text']?></span> </div> <div id="Content"> <div id="NewsHeadline"> <?php foreach ($headlinenews as $news) { echo '<span class="TopNewsHeadline">'.strtoupper($news['headline']).'</span>'; echo '<br />'; echo '<span>written by' .$news['username']. ' on ' $news['timestamp'] '.</span>'; echo '<br />'; echo '<span class="TopNewsText">'.$news['story'].'</span>'; } ?> </div> <img src="" style="NewsSeparator"/> <div id="NewsSecondary"> </div> </div> <div id="NewsLetterBanner"> </div> <div id="ForumPostsContainer"> <img src="images/icon-forum-large.png" class="ForumPostsIcon" /> <span class="ForumPostsText">FORUM POSTS</span><br /> <?php foreach ($forumposts as $posts) { echo '<a href="" class="FrontpageForumLink">'.$posts['threadname']. '</a><br />'; } ?> </div> </div> <div id="Bot"> <div class="BotLinkDiv"> <span class="BotLinkHeadline">LINK-TEXTS</span><br /> <a href="" class="BotLinkText">LINK1</a><br /> <a href="" class="BotLinkText">LINK2</a><br /> <a href="" class="BotLinkText">LINK3</a><br /> <a href="" class="BotLinkText">LINK4</a><br /> <a href="" class="BotLinkText">LINK5</a><br /> <a href="" class="BotLinkText">LINK6</a><br /> </div> <div class="BotLinkDiv"> <span class="BotLinkHeadline">LINK-TEXTS</span><br /> <a href="" class="BotLinkText">LINK1</a><br /> <a href="" class="BotLinkText">LINK2</a><br /> <a href="" class="BotLinkText">LINK3</a><br /> <a href="" class="BotLinkText">LINK4</a><br /> <a href="" class="BotLinkText">LINK5</a><br /> <a href="" class="BotLinkText">LINK6</a><br /> </div> <div class="BotLinkDiv"> <span class="BotLinkHeadline">ACCOUNT</span><br /> <a href="" class="BotLinkText">LOGIN</a><br /> <a href="" class="BotLinkText">CREATE ACCOUNT</a><br /> <a href="" class="BotLinkText">FORGOT PASSWORD</a><br /> <a href="" class="BotLinkText">PROFILE</a><br /> </div> <div class="BotLinkDiv"> <span class="BotLinkTextJoin">NOT A MEMBER?</span> <a href=""><img src="images/buttonjoinnow.png" clas="BotButtonJoinNow" /></a> </div> <div class="BotLinkDiv"> <span class="BotLinkHeadline">SOCIAL</span><br /> <a href="http://www.twitch.tv/indiehjaerta" class="BotLinkText">TWITCH</a><br /> <a href="http://www.facebook.com/indiehjaerta" class="BotLinkText">FACEBOOK</a><br /> <a href="http://www.twitter.com/indiehjaerta" class="BotLinkText">TWITTER</a><br /> <a href="http://www.youtube.com/indiehjaerta" class="BotLinkText">YOUTUBE</a><br /> <a href="http://www.instagram.com/indiehjaerta" class="BotLinkText">INSTAGRAM</a><br /> </div> <div class="BotLinkDiv"> <span class="BotLinkHeadline">SUPPORT</span><br /> <a href="" class="BotLinkText">LINK1</a><br /> <a href="" class="BotLinkText">LINK2</a><br /> <a href="" class="BotLinkText">LINK3</a><br /> <a href="" class="BotLinkText">LINK4</a><br /> <a href="" class="BotLinkText">LINK5</a><br /> <a href="" class="BotLinkText">LINK6</a><br /> </div> <div id="BotLogo"> <a href="#"><span class="DivLink"></span></a> </div> <?php $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $finish = $time; $total_time = round(($finish - $start), 4); ?> <span class="BotLogoText">Page generated in <?php echo $total_time ?> seconds.</span> </div> </div> </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)
5.4.300.0140.04512.54
5.4.290.0050.05012.54
5.4.280.0060.03812.43
5.4.270.0090.04112.43
5.4.260.0080.05312.43
5.4.250.0130.04612.43
5.4.240.0120.03612.43
5.4.230.0040.04112.42
5.4.220.0100.04012.43
5.4.210.0120.04212.43
5.4.200.0090.05312.42
5.4.190.0100.04012.42
5.4.180.0150.03212.42
5.4.170.0130.04512.43
5.4.160.0080.03712.42
5.4.150.0130.04412.42
5.4.140.0090.03912.11
5.4.130.0080.04712.09
5.4.120.0090.04912.06
5.4.110.0110.04912.05
5.4.100.0070.04812.05
5.4.90.0060.05212.05
5.4.80.0030.05412.05
5.4.70.0090.04612.05
5.4.60.0090.04712.04
5.4.50.0080.05012.04
5.4.40.0080.05012.03
5.4.30.0060.04812.03
5.4.20.0070.04812.03
5.4.10.0070.04812.03
5.4.00.0060.05111.53
5.3.280.0040.05312.70
5.3.270.0080.05412.73
5.3.260.0090.04412.72
5.3.250.0110.03612.72
5.3.240.0090.04112.72
5.3.230.0060.04212.71
5.3.220.0060.04212.68
5.3.210.0070.04012.68
5.3.200.0040.03912.68
5.3.190.0070.03712.68
5.3.180.0090.04812.68
5.3.170.0120.04912.67
5.3.160.0050.05612.67
5.3.150.0100.05212.67
5.3.140.0090.05112.66
5.3.130.0070.05612.66
5.3.120.0090.04812.66
5.3.110.0050.04212.65
5.3.100.0070.04012.11
5.3.90.0080.03712.10
5.3.80.0060.04212.09
5.3.70.0070.04212.09
5.3.60.0070.04112.08
5.3.50.0080.04012.03
5.3.40.0150.04212.02
5.3.30.0110.04811.99
5.3.20.0140.03611.77
5.3.10.0080.03611.73
5.3.00.0100.03611.71

preferences:
141.98 ms | 1394 KiB | 7 Q