3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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()); ?>
based on XsRFI
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
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 hhvm-3.12.0
Warning: File not found: token.php in /in/YbWUO on line 2 Fatal error: File not found: api/CManager.php in /in/YbWUO on line 3
Process exited with code 255.
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.4.2 - 4.4.9, 5.1.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.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.