3v4l.org

run code in 300+ PHP versions simultaneously
<?php include 'conf.php'; include 'phpScripts/genCode.php'; include 'phpScripts/SxGeo.php'; $SxGeo = new SxGeo('phpScripts/SxGeo.dat', SXGEO_BATCH | SXGEO_MEMORY); $ip = $_SERVER['REMOTE_ADDR']; $country = $SxGeo->getCountry($ip); if(isset($_COOKIE['sid']) && (isset($_COOKIE['ssid']))){ if(!isset($_COOKIE['substitutioncookie'])){header('Location: phpScripts/logincheck.php');} } if(!isset($_COOKIE['lang']) && (isset($_COOKIE['checkcookie']))){setcookie('lang', 1); header('Location: index.php');} if(isset($_COOKIE['lang'])){ if($_COOKIE['lang'] == 1){ include 'localizations/en_US.php'; }elseif($_COOKIE['lang'] == 2){ include 'localizations/ru_RU.php'; }elseif($_COOKIE['lang'] == 3){ include 'localizations/de_DE.php'; } } if(!isset($_COOKIE['checkcookie'])){ include 'localizations/en_US.php'; } if (isset($_POST['log_in'])) { $login_query = mysqli_query($link, "SELECT email, password, id, folder FROM users WHERE email='".mysqli_real_escape_string($link, $_POST['email'])."' LIMIT 1"); $login_result = mysqli_fetch_assoc($login_query); if ($login_result['password'] === md5(sha1(md5($_POST['password'])).sha1($_POST['password']))) { $_SESSION['user_id'] = $login_result['id']; $hash = md5(generateCode(10)); $id = $login_result['id']; $time = ""; $browser = user_browser($agent); $password = md5(sha1(md5($_POST['password'])).sha1($_POST['password'])); mysqli_query($link, "INSERT INTO sessions SET id='".$id."', browser='".$browser."', sid='".$hash."', country='".$country."'"); setcookie("sid", $hash, time() + 60 * 60 * 24 * 365); setcookie("ssid", $password, time() + 60 * 60 * 24 * 365); if ($login_result['folder'] == 0) { mkdir("images/photos/u".$data['id'].""); mysqli_query($link, "UPDATE users SET folder=1 WHERE email='" . $data['email'] . "'"); } header("Location: loginScript.php"); } else { $err = "<div class='card-panel card-in-card red' style='margin-bottom: 40px;'><center><h5 style=\"font-size: 22px; padding-left: 0px;\" class=\"light white-text text-darken-3 offset-l3\">".$l['incorrect']."</div>"; } } ?>
Output for 7.1.25, 7.2.0 - 7.2.13, 7.3.0 - 7.3.1
Warning: include(): open_basedir restriction in effect. File(conf.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/gic17 on line 2 Warning: include(conf.php): failed to open stream: Operation not permitted in /in/gic17 on line 2 Warning: include(): Failed opening 'conf.php' for inclusion (include_path='.:') in /in/gic17 on line 2 Warning: include(): open_basedir restriction in effect. File(phpScripts/genCode.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/gic17 on line 3 Warning: include(phpScripts/genCode.php): failed to open stream: Operation not permitted in /in/gic17 on line 3 Warning: include(): Failed opening 'phpScripts/genCode.php' for inclusion (include_path='.:') in /in/gic17 on line 3 Warning: include(): open_basedir restriction in effect. File(phpScripts/SxGeo.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/gic17 on line 4 Warning: include(phpScripts/SxGeo.php): failed to open stream: Operation not permitted in /in/gic17 on line 4 Warning: include(): Failed opening 'phpScripts/SxGeo.php' for inclusion (include_path='.:') in /in/gic17 on line 4 Fatal error: Uncaught Error: Class 'SxGeo' not found in /in/gic17:5 Stack trace: #0 {main} thrown in /in/gic17 on line 5
Process exited with code 255.
Output for 7.1.20
Warning: include(): open_basedir restriction in effect. File(conf.php) is not within the allowed path(s): (/tmp:/in) in /in/gic17 on line 2 Warning: include(conf.php): failed to open stream: Operation not permitted in /in/gic17 on line 2 Warning: include(): Failed opening 'conf.php' for inclusion (include_path='.:') in /in/gic17 on line 2 Warning: include(): open_basedir restriction in effect. File(phpScripts/genCode.php) is not within the allowed path(s): (/tmp:/in) in /in/gic17 on line 3 Warning: include(phpScripts/genCode.php): failed to open stream: Operation not permitted in /in/gic17 on line 3 Warning: include(): Failed opening 'phpScripts/genCode.php' for inclusion (include_path='.:') in /in/gic17 on line 3 Warning: include(): open_basedir restriction in effect. File(phpScripts/SxGeo.php) is not within the allowed path(s): (/tmp:/in) in /in/gic17 on line 4 Warning: include(phpScripts/SxGeo.php): failed to open stream: Operation not permitted in /in/gic17 on line 4 Warning: include(): Failed opening 'phpScripts/SxGeo.php' for inclusion (include_path='.:') in /in/gic17 on line 4 Fatal error: Uncaught Error: Class 'SxGeo' not found in /in/gic17:5 Stack trace: #0 {main} thrown in /in/gic17 on line 5
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.10
Warning: include(conf.php): failed to open stream: No such file or directory in /in/gic17 on line 2 Warning: include(): Failed opening 'conf.php' for inclusion (include_path='.:') in /in/gic17 on line 2 Warning: include(phpScripts/genCode.php): failed to open stream: No such file or directory in /in/gic17 on line 3 Warning: include(): Failed opening 'phpScripts/genCode.php' for inclusion (include_path='.:') in /in/gic17 on line 3 Warning: include(phpScripts/SxGeo.php): failed to open stream: No such file or directory in /in/gic17 on line 4 Warning: include(): Failed opening 'phpScripts/SxGeo.php' for inclusion (include_path='.:') in /in/gic17 on line 4 Fatal error: Uncaught Error: Class 'SxGeo' not found in /in/gic17:5 Stack trace: #0 {main} thrown in /in/gic17 on line 5
Process exited with code 255.
Output for 5.1.0 - 5.1.6, 5.2.0 - 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.28
Warning: include(conf.php): failed to open stream: No such file or directory in /in/gic17 on line 2 Warning: include(): Failed opening 'conf.php' for inclusion (include_path='.:') in /in/gic17 on line 2 Warning: include(phpScripts/genCode.php): failed to open stream: No such file or directory in /in/gic17 on line 3 Warning: include(): Failed opening 'phpScripts/genCode.php' for inclusion (include_path='.:') in /in/gic17 on line 3 Warning: include(phpScripts/SxGeo.php): failed to open stream: No such file or directory in /in/gic17 on line 4 Warning: include(): Failed opening 'phpScripts/SxGeo.php' for inclusion (include_path='.:') in /in/gic17 on line 4 Fatal error: Class 'SxGeo' not found in /in/gic17 on line 5
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Warning: main(conf.php): failed to open stream: No such file or directory in /in/gic17 on line 2 Warning: main(): Failed opening 'conf.php' for inclusion (include_path='.:') in /in/gic17 on line 2 Warning: main(phpScripts/genCode.php): failed to open stream: No such file or directory in /in/gic17 on line 3 Warning: main(): Failed opening 'phpScripts/genCode.php' for inclusion (include_path='.:') in /in/gic17 on line 3 Warning: main(phpScripts/SxGeo.php): failed to open stream: No such file or directory in /in/gic17 on line 4 Warning: main(): Failed opening 'phpScripts/SxGeo.php' for inclusion (include_path='.:') in /in/gic17 on line 4 Fatal error: Class 'SxGeo' not found in /in/gic17 on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Warning: main(conf.php): failed to open stream: No such file or directory in /in/gic17 on line 2 Warning: main(): Failed opening 'conf.php' for inclusion (include_path='.:') in /in/gic17 on line 2 Warning: main(phpScripts/genCode.php): failed to open stream: No such file or directory in /in/gic17 on line 3 Warning: main(): Failed opening 'phpScripts/genCode.php' for inclusion (include_path='.:') in /in/gic17 on line 3 Warning: main(phpScripts/SxGeo.php): failed to open stream: No such file or directory in /in/gic17 on line 4 Warning: main(): Failed opening 'phpScripts/SxGeo.php' for inclusion (include_path='.:') in /in/gic17 on line 4 Fatal error: Cannot instantiate non-existent class: sxgeo in /in/gic17 on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: main(conf.php) [http://www.php.net/function.main]: failed to create stream: No such file or directory in /in/gic17 on line 2 Warning: main() [http://www.php.net/function.main]: Failed opening 'conf.php' for inclusion (include_path='.:') in /in/gic17 on line 2 Warning: main(phpScripts/genCode.php) [http://www.php.net/function.main]: failed to create stream: No such file or directory in /in/gic17 on line 3 Warning: main() [http://www.php.net/function.main]: Failed opening 'phpScripts/genCode.php' for inclusion (include_path='.:') in /in/gic17 on line 3 Warning: main(phpScripts/SxGeo.php) [http://www.php.net/function.main]: failed to create stream: No such file or directory in /in/gic17 on line 4 Warning: main() [http://www.php.net/function.main]: Failed opening 'phpScripts/SxGeo.php' for inclusion (include_path='.:') in /in/gic17 on line 4 Fatal error: Cannot instantiate non-existent class: sxgeo in /in/gic17 on line 5

preferences:
211.52 ms | 403 KiB | 233 Q