3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php ini_set('display_errors', 'On'); error_reporting(E_ALL); $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $start = $time; session_start(); 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 - Members</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 /> <!-- Member Edit Start --> <?php //if ($_GET['action'] == 'edit') if (FALSE) { ?> Edit User! <?php } ?> <!-- Member Edit End --> <?php else { ?> <!-- Member List Start --> <?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(); } $query = mysqli_query($sqli, "SELECT * FROM members ORDER BY id") or die("Error: ".mysqli_error($sqli)); echo "<table border='0'> <tr> <th>ID</th> <th>UserName</th> <th>EDIT</th> </tr>"; while ($row = mysqli_fetch_array($query)) { echo "<tr>"; echo "<td>" . $row['id'] . "</td>"; echo "<td>" . $row['username'] . "</td>"; //echo '<td><a href="members.php?action=edit"</td>'; echo "</tr>"; } echo "</table>"; } ?> <!-- Member List 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 5.4.0 - 5.4.28
Parse error: syntax error, unexpected 'else' (T_ELSE) in /in/2a6tW on line 61
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.28
Parse error: syntax error, unexpected T_ELSE in /in/2a6tW on line 61
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_ELSE in /in/2a6tW on line 61
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/2a6tW on line 61
Process exited with code 255.