3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.0.14 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Warning: realpath(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/tmp:/in:/etc) in /in/ne50i on line 20 Fatal error: Uncaught TypeError: simplexml_load_file(): Argument #2 ($class_name) must be a class name derived from SimpleXMLElement or null, 1 given in /in/ne50i:22 Stack trace: #0 /in/ne50i(22): simplexml_load_file('\\C:\nmpp\\htdocs\\...', '1') #1 {main} thrown in /in/ne50i on line 22
Process exited with code 255.
Output for 8.0.0 - 8.0.13
Fatal error: Uncaught TypeError: simplexml_load_file(): Argument #2 ($class_name) must be a class name derived from SimpleXMLElement or null, 1 given in /in/ne50i:22 Stack trace: #0 /in/ne50i(22): simplexml_load_file('/\\C:\nmpp\\htdocs...', '1') #1 {main} thrown in /in/ne50i on line 22
Process exited with code 255.
Output for 7.4.33
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 'section' of non-object in /in/ne50i on line 25 Notice: Trying to access array offset on value of type null in /in/ne50i on line 25 Notice: Trying to get property 'setting' of non-object in /in/ne50i on line 25 Notice: Trying to access array offset on value of type null in /in/ne50i on line 25 Notice: Trying to get property 'section' of non-object in /in/ne50i on line 26 Notice: Trying to access array offset on value of type null in /in/ne50i on line 26 Notice: Trying to get property 'setting' of non-object in /in/ne50i on line 26 Notice: Trying to access array offset on value of type null in /in/ne50i on line 26 Notice: Trying to get property 'section' of non-object in /in/ne50i on line 27 Notice: Trying to access array offset on value of type null in /in/ne50i on line 27 Notice: Trying to get property 'setting' of non-object in /in/ne50i on line 27 Notice: Trying to access array offset on value of type null in /in/ne50i on line 27 Notice: Trying to get property 'section' of non-object in /in/ne50i on line 28 Notice: Trying to access array offset on value of type null in /in/ne50i on line 28 Notice: Trying to get property 'setting' of non-object in /in/ne50i on line 28 Notice: Trying to access array offset on value of type null in /in/ne50i on line 28 Notice: Trying to access array offset on value of type bool in /in/ne50i on line 29 Notice: Trying to access array offset on value of type null in /in/ne50i on line 29 Notice: Trying to access array offset on value of type bool in /in/ne50i on line 30 Notice: Trying to access array offset on value of type null in /in/ne50i on line 30 Notice: Trying to access array offset on value of type bool in /in/ne50i on line 31 Notice: Trying to access array offset on value of type null in /in/ne50i on line 31 Notice: Trying to access array offset on value of type bool in /in/ne50i on line 32 Notice: Trying to access array offset on value of type null in /in/ne50i on line 32 Notice: Trying to access array offset on value of type bool in /in/ne50i on line 33 Notice: Trying to access array offset on value of type null in /in/ne50i on line 33 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 7.4.26 - 7.4.32
Warning: realpath(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/tmp:/in:/etc) in /in/ne50i on line 20 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(): open_basedir restriction in effect. File(\@dayzcc_config\1\HiveExt.ini) is not within the allowed path(s): (/tmp:/in:/etc) in /in/ne50i on line 23 Warning: parse_ini_file(\@dayzcc_config\1\HiveExt.ini): failed to open stream: Operation not permitted in /in/ne50i on line 23 Notice: Trying to get property 'section' of non-object in /in/ne50i on line 25 Notice: Trying to access array offset on value of type null in /in/ne50i on line 25 Notice: Trying to get property 'setting' of non-object in /in/ne50i on line 25 Notice: Trying to access array offset on value of type null in /in/ne50i on line 25 Notice: Trying to get property 'section' of non-object in /in/ne50i on line 26 Notice: Trying to access array offset on value of type null in /in/ne50i on line 26 Notice: Trying to get property 'setting' of non-object in /in/ne50i on line 26 Notice: Trying to access array offset on value of type null in /in/ne50i on line 26 Notice: Trying to get property 'section' of non-object in /in/ne50i on line 27 Notice: Trying to access array offset on value of type null in /in/ne50i on line 27 Notice: Trying to get property 'setting' of non-object in /in/ne50i on line 27 Notice: Trying to access array offset on value of type null in /in/ne50i on line 27 Notice: Trying to get property 'section' of non-object in /in/ne50i on line 28 Notice: Trying to access array offset on value of type null in /in/ne50i on line 28 Notice: Trying to get property 'setting' of non-object in /in/ne50i on line 28 Notice: Trying to access array offset on value of type null in /in/ne50i on line 28 Notice: Trying to access array offset on value of type bool in /in/ne50i on line 29 Notice: Trying to access array offset on value of type null in /in/ne50i on line 29 Notice: Trying to access array offset on value of type bool in /in/ne50i on line 30 Notice: Trying to access array offset on value of type null in /in/ne50i on line 30 Notice: Trying to access array offset on value of type bool in /in/ne50i on line 31 Notice: Trying to access array offset on value of type null in /in/ne50i on line 31 Notice: Trying to access array offset on value of type bool in /in/ne50i on line 32 Notice: Trying to access array offset on value of type null in /in/ne50i on line 32 Notice: Trying to access array offset on value of type bool in /in/ne50i on line 33 Notice: Trying to access array offset on value of type null in /in/ne50i on line 33 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 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.25
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 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.3 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
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 Fatal error: Class 'mysqli' not found in /in/ne50i on line 35
Process exited with code 255.
Output for 5.2.0 - 5.2.2
<br /> <b>Warning</b>: simplexml_load_file() expects parameter 2 to be a class name derived from SimpleXMLElement, '1' given in <b>/in/ne50i</b> on line <b>22</b><br /> <br /> <b>Warning</b>: parse_ini_file(/\@dayzcc_config\1\HiveExt.ini) [<a href='function.parse-ini-file'>function.parse-ini-file</a>]: failed to open stream: No such file or directory in <b>/in/ne50i</b> on line <b>23</b><br /> <br /> <b>Fatal error</b>: Class 'mysqli' not found in <b>/in/ne50i</b> on line <b>35</b><br />
Process exited with code 255.
Output for 5.1.0 - 5.1.6
<br /> <b>Warning</b>: simplexml_load_file() [<a href='function.simplexml-load-file'>function.simplexml-load-file</a>]: I/O warning : failed to load external entity &quot;/\C: mpp\htdocs\@dayzcc_config\1\settings.xml&quot; in <b>/in/ne50i</b> on line <b>22</b><br /> <br /> <b>Warning</b>: parse_ini_file(/\@dayzcc_config\1\HiveExt.ini) [<a href='function.parse-ini-file'>function.parse-ini-file</a>]: failed to open stream: No such file or directory in <b>/in/ne50i</b> on line <b>23</b><br /> <br /> <b>Fatal error</b>: Class 'mysqli' not found in <b>/in/ne50i</b> on line <b>35</b><br />
Process exited with code 255.
Output for 5.0.0 - 5.0.5
<br /> <b>Warning</b>: I/O warning : failed to load external entity "/\C: mpp\htdocs\@dayzcc_config\1\settings.xml" in <b>/in/ne50i</b> on line <b>22</b><br /> <br /> <b>Warning</b>: parse_ini_file(/\@dayzcc_config\1\HiveExt.ini) [<a href='function.parse-ini-file'>function.parse-ini-file</a>]: failed to open stream: No such file or directory in <b>/in/ne50i</b> on line <b>23</b><br /> <br /> <b>Fatal error</b>: Class 'mysqli' not found in <b>/in/ne50i</b> on line <b>35</b><br />
Process exited with code 255.
Output for 4.4.5 - 4.4.9
<br /> <b>Fatal error</b>: Call to undefined function: simplexml_load_file() in <b>/in/ne50i</b> on line <b>22</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
<br /> <b>Fatal error</b>: Call to undefined function: simplexml_load_file() in <b>/in/ne50i</b> on line <b>22</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br /> <b>Fatal error</b>: Call to undefined function: simplexml_load_file() in <b>/in/ne50i</b> on line <b>22</b><br />

preferences:
297.79 ms | 401 KiB | 464 Q