3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // Multi instance support was written by Krunch if (!isset($_SESSION['user_id']) || isset($_GET["instance"])) { if (isset($_POST["instance"])) { $serverinstance = intval($_POST["instance"]); } else if (isset($_GET["instance"])) { if ($_GET["instance"] > 0) { $serverinstance = intval($_GET["instance"]); } else { $serverinstance = 1; } } else { $serverinstance = 1; } $_SESSION["serverinstance"] = $serverinstance; $_SESSION["patharma"] = $patharma = realpath(dirname(__FILE__) . "/../../.."); $settings = simplexml_load_file($patharma."\\C:\xampp\htdocs\@dayzcc_config\\$serverinstance\\settings.xml", true); $hive = parse_ini_file($patharma."\\@dayzcc_config\\$serverinstance\\HiveExt.ini", true); $_SESSION["servermodlist"] = $servermodlist = (string)$settings->section[1]->setting[1]; $_SESSION["serverip"] = $serverip = (string)$settings->section[2]->setting[2]; $_SESSION["serverport"] = $serverport = (string)$settings->section[3]->setting[3]; $_SESSION["rconpassword"] = $rconpassword = (string)$settings->section[4]->setting[4]; $_SESSION["dbhost"] = $dbhost = $hive["Database"]["Host"]; $_SESSION["dbport"] = $dbport = $hive["Database"]["Port"]; $_SESSION["dbuser"] = $dbuser = $hive["Database"]["Username"]; $_SESSION["dbpass"] = $dbpass = $hive["Database"]["Password"]; $_SESSION["dbname"] = $dbname = $hive["Database"]["Database"]; $dbh = new mysqli($dbhost.':'.$dbport, $dbuser, $dbpass, $dbname); if ($dbh->connect_errno) { echo $dbh->connect_error; exit; } $sth = $dbh->prepare("select world.name from instance inner join world on instance.world_id = world.id where instance.id = ?"); $sth->bind_param("i", $serverinstance); $sth->execute() or die($sth->error); $sth->bind_result($serverworld); $sth->fetch() or die($sth->error); $sth->close(); $_SESSION["serverworld"] = $serverworld; } else { $serverinstance = $_SESSION["serverinstance"]; $patharma = $_SESSION["patharma"]; $servermodlist = $_SESSION["servermodlist"]; $serverip = $_SESSION["serverip"]; $serverport = $_SESSION["serverport"]; $rconpassword = $_SESSION["rconpassword"]; $dbhost = $_SESSION["dbhost"]; $dbport = $_SESSION["dbport"]; $dbuser = $_SESSION["dbuser"]; $dbpass = $_SESSION["dbpass"]; $dbname = $_SESSION["dbname"]; $serverworld = $_SESSION["serverworld"]; } $sitename = "DayZ Controlcenter (Instance ".$serverinstance.")"; $exeserver = "arma2oaserver_".$serverinstance.".exe"; $pathserver = $patharma."\\@dayzcc_config\\".$serverinstance."\\".$exeserver; ?>
Output for 7.0.0 - 7.1.0
Warning: simplexml_load_file() expects parameter 2 to be a class name derived from SimpleXMLElement, '1' given in /in/ne50i on line 22 Warning: parse_ini_file(/\@dayzcc_config\1\HiveExt.ini): failed to open stream: No such file or directory in /in/ne50i on line 23 Notice: Trying to get property of non-object in /in/ne50i on line 25 Notice: Trying to get property of non-object in /in/ne50i on line 25 Notice: Trying to get property of non-object in /in/ne50i on line 26 Notice: Trying to get property of non-object in /in/ne50i on line 26 Notice: Trying to get property of non-object in /in/ne50i on line 27 Notice: Trying to get property of non-object in /in/ne50i on line 27 Notice: Trying to get property of non-object in /in/ne50i on line 28 Notice: Trying to get property of non-object in /in/ne50i on line 28 Fatal error: Uncaught Error: Class 'mysqli' not found in /in/ne50i:35 Stack trace: #0 {main} thrown in /in/ne50i on line 35
Process exited with code 255.
Output for 5.2.7 - 5.6.28
Warning: simplexml_load_file() expects parameter 2 to be a class name derived from SimpleXMLElement, '1' given in /in/ne50i on line 22 Warning: parse_ini_file(/\@dayzcc_config\1\HiveExt.ini): failed to open stream: No such file or directory in /in/ne50i on line 23 Notice: Trying to get property of non-object in /in/ne50i on line 25 Notice: Trying to get property of non-object in /in/ne50i on line 25 Notice: Trying to get property of non-object in /in/ne50i on line 26 Notice: Trying to get property of non-object in /in/ne50i on line 26 Notice: Trying to get property of non-object in /in/ne50i on line 27 Notice: Trying to get property of non-object in /in/ne50i on line 27 Notice: Trying to get property of non-object in /in/ne50i on line 28 Notice: Trying to get property of non-object in /in/ne50i on line 28 Fatal error: Class 'mysqli' not found in /in/ne50i on line 35
Process exited with code 255.
Output for 5.2.0 - 5.2.6
Warning: simplexml_load_file() expects parameter 2 to be a class name derived from SimpleXMLElement, '1' given in /in/ne50i on line 22 Warning: parse_ini_file(/\@dayzcc_config\1\HiveExt.ini): failed to open stream: No such file or directory in /in/ne50i on line 23 Notice: Trying to get property of non-object in /in/ne50i on line 25 Notice: Trying to get property of non-object in /in/ne50i on line 25 Notice: Trying to get property of non-object in /in/ne50i on line 26 Notice: Trying to get property of non-object in /in/ne50i on line 26 Notice: Trying to get property of non-object in /in/ne50i on line 27 Notice: Trying to get property of non-object in /in/ne50i on line 27 Notice: Trying to get property of non-object in /in/ne50i on line 28 Notice: Trying to get property of non-object in /in/ne50i on line 28 Notice: Undefined index: Database in /in/ne50i on line 29 Notice: Undefined index: Database in /in/ne50i on line 30 Notice: Undefined index: Database in /in/ne50i on line 31 Notice: Undefined index: Database in /in/ne50i on line 32 Notice: Undefined index: Database in /in/ne50i on line 33 Fatal error: Class 'mysqli' not found in /in/ne50i on line 35
Process exited with code 255.
Output for 5.1.0 - 5.1.6
Warning: simplexml_load_file(): I/O warning : failed to load external entity "/\C: mpp\htdocs\@dayzcc_config\1\settings.xml" in /in/ne50i on line 22 Warning: parse_ini_file(/\@dayzcc_config\1\HiveExt.ini): failed to open stream: No such file or directory in /in/ne50i on line 23 Notice: Trying to get property of non-object in /in/ne50i on line 25 Notice: Trying to get property of non-object in /in/ne50i on line 25 Notice: Trying to get property of non-object in /in/ne50i on line 26 Notice: Trying to get property of non-object in /in/ne50i on line 26 Notice: Trying to get property of non-object in /in/ne50i on line 27 Notice: Trying to get property of non-object in /in/ne50i on line 27 Notice: Trying to get property of non-object in /in/ne50i on line 28 Notice: Trying to get property of non-object in /in/ne50i on line 28 Notice: Undefined index: Database in /in/ne50i on line 29 Notice: Undefined index: Database in /in/ne50i on line 30 Notice: Undefined index: Database in /in/ne50i on line 31 Notice: Undefined index: Database in /in/ne50i on line 32 Notice: Undefined index: Database in /in/ne50i on line 33 Fatal error: Class 'mysqli' not found in /in/ne50i on line 35
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Warning: I/O warning : failed to load external entity "/\C: mpp\htdocs\@dayzcc_config\1\settings.xml" in /in/ne50i on line 22 Warning: parse_ini_file(/\@dayzcc_config\1\HiveExt.ini): failed to open stream: No such file or directory in /in/ne50i on line 23 Notice: Trying to get property of non-object in /in/ne50i on line 25 Notice: Trying to get property of non-object in /in/ne50i on line 25 Notice: Trying to get property of non-object in /in/ne50i on line 26 Notice: Trying to get property of non-object in /in/ne50i on line 26 Notice: Trying to get property of non-object in /in/ne50i on line 27 Notice: Trying to get property of non-object in /in/ne50i on line 27 Notice: Trying to get property of non-object in /in/ne50i on line 28 Notice: Trying to get property of non-object in /in/ne50i on line 28 Notice: Undefined index: Database in /in/ne50i on line 29 Notice: Undefined index: Database in /in/ne50i on line 30 Notice: Undefined index: Database in /in/ne50i on line 31 Notice: Undefined index: Database in /in/ne50i on line 32 Notice: Undefined index: Database in /in/ne50i on line 33 Fatal error: Class 'mysqli' not found in /in/ne50i on line 35
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: simplexml_load_file() in /in/ne50i on line 22
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: simplexml_load_file() in /in/ne50i on line 22
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: simplexml_load_file() in /in/ne50i on line 22