3v4l.org

run code in 300+ PHP versions simultaneously
<?php include 'token.php'; require_once 'api/CManager.php'; $Manager = new \teachme\CManager(); $DB = $Manager->GetDB(); if(!$Manager->Valid()) { header("X-API-Status: 40002 Invalid Manager"); die(); } if(preg_match("/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/", $_POST["mail"]) != 1) { header("X-API-Status: 44003 Mail invalid"); die(); } if($Manager->GetUsers("WHERE `".$DB["Tables"]["Users"]["Mail"]."` LIKE '".$Manager->EscapeString($_POST["mail"])."'") !== FALSE) { header("X-API-Status: 44004 Mail exists"); die(); } $Entry = new \teachme\CUser(); $Entry->SetName($_POST["name"]); $Entry->SetMail($_POST["mail"]); if(isset($_POST["password"]) && strlen($_POST["password"]) > 0) { $Entry->SetPassword($_POST["password"]); } if(strpos($Client["OS"], "iOS") !== FALSE) { $_POST["offers"] = explode($iOSDelimiter, $_POST["offers"]); $_POST["requests"] = explode($iOSDelimiter, $_POST["requests"]); } $Entry->SetPhone($_POST["phone"]); $Entry->SetUniversity($_POST["university"]); $Entry->SetOffers("µ".implode("µµ", $_POST["offers"])."µ"); $Entry->SetRequests("µ".implode("µµ", $_POST["requests"])."µ"); $Entry->SetPriceOffer($_POST["priceoffer"]); $Entry->SetPriceRequest($_POST["pricerequest"]); $Entry->SetBirthday($_POST["birthday"]); $Entry->SetGender($_POST["gender"]); $Entry->SetSemester($_POST["semester"]); $Entry->SetAbout($_POST["about"]); $Entry->SetTimes($_POST["times"]); $Entry->SetLastActivity(now()); $Entry->SetRegistration(now()); $Entry->SetActive(1); if(!$Manager->Save($Entry)) { header("X-API-Status: 44002 Saving Failed"); die(); } if(($User = $Manager->GetUsers("WHERE `".$DB["Tables"]["Users"]["Mail"]."` LIKE '".$Manager->EscapeString($_POST["mail"])."'")) !== false) { $Entry = $User[0]; } $_SESSION["TeachMe-Server"]["loggedin"] = true; $_SESSION["TeachMe-Server"]["User"] = $Entry->ToArray(); PrintResult($Entry->ToArray()); ?>
Output for 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Warning: include(): open_basedir restriction in effect. File(token.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/YbWUO on line 2 Warning: include(token.php): Failed to open stream: Operation not permitted in /in/YbWUO on line 2 Warning: include(): Failed opening 'token.php' for inclusion (include_path='.:') in /in/YbWUO on line 2 Warning: require_once(): open_basedir restriction in effect. File(api/CManager.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/YbWUO on line 3 Warning: require_once(api/CManager.php): Failed to open stream: Operation not permitted in /in/YbWUO on line 3 Fatal error: Uncaught Error: Failed opening required 'api/CManager.php' (include_path='.:') in /in/YbWUO:3 Stack trace: #0 {main} thrown in /in/YbWUO on line 3
Process exited with code 255.
Output for 8.0.13
Warning: include(token.php): Failed to open stream: No such file or directory in /in/YbWUO on line 2 Warning: include(): Failed opening 'token.php' for inclusion (include_path='.:') in /in/YbWUO on line 2 Warning: require_once(api/CManager.php): Failed to open stream: No such file or directory in /in/YbWUO on line 3 Fatal error: Uncaught Error: Failed opening required 'api/CManager.php' (include_path='.:') in /in/YbWUO:3 Stack trace: #0 {main} thrown in /in/YbWUO on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.7, 7.3.32 - 7.3.33, 7.4.33
Warning: include(token.php): failed to open stream: No such file or directory in /in/YbWUO on line 2 Warning: include(): Failed opening 'token.php' for inclusion (include_path='.:') in /in/YbWUO on line 2 Warning: require_once(api/CManager.php): failed to open stream: No such file or directory in /in/YbWUO on line 3 Fatal error: require_once(): Failed opening required 'api/CManager.php' (include_path='.:') in /in/YbWUO on line 3
Process exited with code 255.
Output for 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.32
Warning: include(): open_basedir restriction in effect. File(token.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/YbWUO on line 2 Warning: include(token.php): failed to open stream: Operation not permitted in /in/YbWUO on line 2 Warning: include(): Failed opening 'token.php' for inclusion (include_path='.:') in /in/YbWUO on line 2 Warning: require_once(): open_basedir restriction in effect. File(api/CManager.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/YbWUO on line 3 Warning: require_once(api/CManager.php): failed to open stream: Operation not permitted in /in/YbWUO on line 3 Fatal error: require_once(): Failed opening required 'api/CManager.php' (include_path='.:') in /in/YbWUO on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/YbWUO on line 5 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/YbWUO on line 5 Parse error: syntax error, unexpected T_STRING in /in/YbWUO on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/YbWUO on line 5 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/YbWUO on line 5 Parse error: parse error, unexpected T_STRING in /in/YbWUO on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/YbWUO on line 5 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/YbWUO on line 5 Parse error: parse error in /in/YbWUO on line 5
Process exited with code 255.

preferences:
251.43 ms | 402 KiB | 326 Q