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; define("DB_HOST","mysql117.loopia.se"); define("DB_USER","normal@i103189"); define("DB_PASS","KungMicke87"); define("DB_NAME","indiehjaerta_com"); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <title>indiehjaerta.com - Forum</title> <link href="style_test.css" rel="stylesheet" type="text/css" /> </head> <body> <a href="login.php">Login<a/> - <a href="admin.php">Admin<a/> - <a href="members.php">Members<a/> - <a href="register.php">Register<a/> - <a href="blog.php">Blog<a/> - <a href="news.php">News<a/> - <a href="event.php">Event<a/> - <a href="forum.php">Forum<a/> - <a href="profile.php">Profile<a/> - <a href="logout.php">Logout<a/> <br /> <br /> <!-- New Post Start --> <!-- New Post End --> <!-- List Forum Category Threads - Start --> <?php if (isset($_GET['fid'])) { if (isset($_GET['tid'])) { // 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(); } $query = mysqli_query($sqli, "SELECT * FROM forumtopics ORDER BY id") or die("Error: ".mysqli_error($sqli)); //Don't order by ID! $checkthreadexists = mysqli_num_rows($query); // Check if we have ny threads in this category if($checkthreadexists == 0) { // No threads echo '<span class="text">No such topic ID exists!</span><br />'; } else { } } else { // 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(); } $fid = $_GET['fid']; $query = mysqli_query($sqli, "SELECT * FROM forumtopics ORDER BY id WHERE categoryid='$fid'") or die("Error: ".mysqli_error($sqli)); //Don't order by ID! $checknumthreads = mysqli_num_rows($query); // Check if we have ny threads in this category if($checknumthreads == 0) { // No threads echo '<span class="text">No forums threads found in the database!</span><br />'; } else { echo '<table border="0"> <tr> <th><span class="text">Name</span></th> <th></th> <th><span class="text">Replies</span></th> <th></th> </tr>'; while ($row = mysqli_fetch_array($query)) { echo '<tr>'; echo '<td><a href="?fid=' .$_GET['fid']. '&tid=' .$row['id']. '"><span class="text">' .$row['threadname']. '</span></a></td>'; echo '<td></td>'; echo '<td><span class="text">0</span></td>'; echo '<td></td>'; echo '</tr>'; } echo '</table><br />'; } } ?> <!-- List Forum Category Threads - End --> <!-- List Forum Categories - Start --> <?php } else { // 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(); } $query = mysqli_query($sqli, "SELECT * FROM forumcat ORDER BY id") or die("Error: ".mysqli_error($sqli)); $checknumforums = mysqli_num_rows($query); // Check if we have any forum categories if($checknumforums == 0) { // No forums echo '<span class="text">No forums found in the database!</span><br />'; } else { echo '<table border="0"> <tr> <th><span class="text">Name</span></th> <th></th> <th><span class="text">Threads</span></th> <th></th> </tr>'; while ($row = mysqli_fetch_array($query)) { echo '<tr>'; echo '<td><a href="?fid=' .$row['id']. '"><span class="text">' .$row['forumname']. '</span></a></td>'; echo '<td></td>'; echo '<td><span class="text">0</span></td>'; echo '<td></td>'; echo '</tr>'; } echo '</table><br />'; } } ?> <!-- List Forum Categories - End --> <?php $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $finish = $time; $total_time = round(($finish - $start), 4); echo '<span class="text">Page generated in '.$total_time.' seconds.</span><br />'; ?> </body> </html>
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.13, 7.3.0 - 7.3.1
<html> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <title>indiehjaerta.com - Forum</title> <link href="style_test.css" rel="stylesheet" type="text/css" /> </head> <body> <a href="login.php">Login<a/> - <a href="admin.php">Admin<a/> - <a href="members.php">Members<a/> - <a href="register.php">Register<a/> - <a href="blog.php">Blog<a/> - <a href="news.php">News<a/> - <a href="event.php">Event<a/> - <a href="forum.php">Forum<a/> - <a href="profile.php">Profile<a/> - <a href="logout.php">Logout<a/> <br /> <br /> <!-- New Post Start --> <!-- New Post End --> <!-- List Forum Category Threads - Start --> Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in /in/XTo1J:131 Stack trace: #0 {main} thrown in /in/XTo1J on line 131
Process exited with code 255.
Output for 5.4.34 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
<html> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <title>indiehjaerta.com - Forum</title> <link href="style_test.css" rel="stylesheet" type="text/css" /> </head> <body> <a href="login.php">Login<a/> - <a href="admin.php">Admin<a/> - <a href="members.php">Members<a/> - <a href="register.php">Register<a/> - <a href="blog.php">Blog<a/> - <a href="news.php">News<a/> - <a href="event.php">Event<a/> - <a href="forum.php">Forum<a/> - <a href="profile.php">Profile<a/> - <a href="logout.php">Logout<a/> <br /> <br /> <!-- New Post Start --> <!-- New Post End --> <!-- List Forum Category Threads - Start --> Fatal error: Call to undefined function mysqli_connect() in /in/XTo1J on line 131
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.32
Warning: ini_set() has been disabled for security reasons in /in/XTo1J on line 2 <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <title>indiehjaerta.com - Forum</title> <link href="style_test.css" rel="stylesheet" type="text/css" /> </head> <body> <a href="login.php">Login<a/> - <a href="admin.php">Admin<a/> - <a href="members.php">Members<a/> - <a href="register.php">Register<a/> - <a href="blog.php">Blog<a/> - <a href="news.php">News<a/> - <a href="event.php">Event<a/> - <a href="forum.php">Forum<a/> - <a href="profile.php">Profile<a/> - <a href="logout.php">Logout<a/> <br /> <br /> <!-- New Post Start --> <!-- New Post End --> <!-- List Forum Category Threads - Start --> Fatal error: Call to undefined function mysqli_connect() in /in/XTo1J on line 131
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Warning: ini_set() has been disabled for security reasons in /in/XTo1J on line 2 <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <title>indiehjaerta.com - Forum</title> <link href="style_test.css" rel="stylesheet" type="text/css" /> </head> <body> <a href="login.php">Login<a/> - <a href="admin.php">Admin<a/> - <a href="members.php">Members<a/> - <a href="register.php">Register<a/> - <a href="blog.php">Blog<a/> - <a href="news.php">News<a/> - <a href="event.php">Event<a/> - <a href="forum.php">Forum<a/> - <a href="profile.php">Profile<a/> - <a href="logout.php">Logout<a/> <br /> <br /> <!-- New Post Start --> <!-- New Post End --> <!-- List Forum Category Threads - Start --> Fatal error: Call to undefined function: mysqli_connect() in /in/XTo1J on line 131
Process exited with code 255.
Output for 4.3.5 - 4.3.11, 4.4.0 - 4.4.4
Warning: ini_set() has been disabled for security reasons in /in/XTo1J on line 2 <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <title>indiehjaerta.com - Forum</title> <link href="style_test.css" rel="stylesheet" type="text/css" /> </head> <body> <a href="login.php">Login<a/> - <a href="admin.php">Admin<a/> - <a href="members.php">Members<a/> - <a href="register.php">Register<a/> - <a href="blog.php">Blog<a/> - <a href="news.php">News<a/> - <a href="event.php">Event<a/> - <a href="forum.php">Forum<a/> - <a href="profile.php">Profile<a/> - <a href="logout.php">Logout<a/> <br /> <br /> <!-- New Post Start --> <!-- New Post End --> <!-- List Forum Category Threads - Start --> Fatal error: Call to undefined function: mysqli_connect() in /in/XTo1J on line 131
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Warning: ini_set,pcntl_fork() has been disabled for security reasons in /in/XTo1J on line 2 <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <title>indiehjaerta.com - Forum</title> <link href="style_test.css" rel="stylesheet" type="text/css" /> </head> <body> <a href="login.php">Login<a/> - <a href="admin.php">Admin<a/> - <a href="members.php">Members<a/> - <a href="register.php">Register<a/> - <a href="blog.php">Blog<a/> - <a href="news.php">News<a/> - <a href="event.php">Event<a/> - <a href="forum.php">Forum<a/> - <a href="profile.php">Profile<a/> - <a href="logout.php">Logout<a/> <br /> <br /> <!-- New Post Start --> <!-- New Post End --> <!-- List Forum Category Threads - Start --> Fatal error: Call to undefined function: mysqli_connect() in /in/XTo1J on line 131
Process exited with code 255.
Output for 4.3.1
Warning: ini_set,pcntl_fork() has been disabled for security reasons in /in/XTo1J on line 2 <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <title>indiehjaerta.com - Forum</title> <link href="style_test.css" rel="stylesheet" type="text/css" /> </head> <body> <a href="login.php">Login<a/> - <a href="admin.php">Admin<a/> - <a href="members.php">Members<a/> - <a href="register.php">Register<a/> - <a href="blog.php">Blog<a/> - <a href="news.php">News<a/> - <a href="event.php">Event<a/> - <a href="forum.php">Forum<a/> - <a href="profile.php">Profile<a/> - <a href="logout.php">Logout<a/> <br /> <br /> <!-- New Post Start --> <!-- New Post End --> <!-- List Forum Category Threads - Start --> Fatal error: Call to undefined function: mysqli_connect() in /in/XTo1J on line 131
Output for 4.3.0
<html> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <title>indiehjaerta.com - Forum</title> <link href="style_test.css" rel="stylesheet" type="text/css" /> </head> <body> <a href="login.php">Login<a/> - <a href="admin.php">Admin<a/> - <a href="members.php">Members<a/> - <a href="register.php">Register<a/> - <a href="blog.php">Blog<a/> - <a href="news.php">News<a/> - <a href="event.php">Event<a/> - <a href="forum.php">Forum<a/> - <a href="profile.php">Profile<a/> - <a href="logout.php">Logout<a/> <br /> <br /> <!-- New Post Start --> <!-- New Post End --> <!-- List Forum Category Threads - Start -->

preferences:
150.48 ms | 402 KiB | 190 Q