3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php session_start(); include('pdo.php'); require_once 'tools/HTMLPurifier.standalone.php'; $editFlag = $_POST['editFlag'] ?? false; $contentID = $_POST['id'] ?? false; $userContent = $_POST['userContent'] ?? false; $section = 1; $config = HTMLPurifier_Config::createDefault(); $purifier = new HTMLPurifier($config); $clean_html = $purifier->purify($userContent); if ($editFlag != "1"){ $stmt = $db->prepare("INSERT INTO userContent (section, author, content) VALUES (:section, :author, :content)"); $stmt->execute(['section' => $section, 'author' => $author, 'content' => $content]); } else { $stmt = $db->prepare("UPDATE userContent SET section=:section, author=:author, content=:content WHERE id=:contentID"); $stmt->execute(['section' => $section, 'author' => $author, 'content' => $content, 'contentID' => $contentID]); } ?>
Output for 7.1.20, 7.2.6
Warning: include(): open_basedir restriction in effect. File(pdo.php) is not within the allowed path(s): (/tmp:/in) in /in/Jb5Ga on line 3 Warning: include(pdo.php): failed to open stream: Operation not permitted in /in/Jb5Ga on line 3 Warning: include(): Failed opening 'pdo.php' for inclusion (include_path='.:') in /in/Jb5Ga on line 3 Warning: require_once(): open_basedir restriction in effect. File(tools/HTMLPurifier.standalone.php) is not within the allowed path(s): (/tmp:/in) in /in/Jb5Ga on line 4 Warning: require_once(tools/HTMLPurifier.standalone.php): failed to open stream: Operation not permitted in /in/Jb5Ga on line 4 Fatal error: require_once(): Failed opening required 'tools/HTMLPurifier.standalone.php' (include_path='.:') in /in/Jb5Ga on line 4
Process exited with code 255.
Output for 7.0.0 - 7.1.10, 7.2.0
Warning: include(pdo.php): failed to open stream: No such file or directory in /in/Jb5Ga on line 3 Warning: include(): Failed opening 'pdo.php' for inclusion (include_path='.:') in /in/Jb5Ga on line 3 Warning: require_once(tools/HTMLPurifier.standalone.php): failed to open stream: No such file or directory in /in/Jb5Ga on line 4 Fatal error: require_once(): Failed opening required 'tools/HTMLPurifier.standalone.php' (include_path='.:') in /in/Jb5Ga on line 4
Process exited with code 255.
Output for hhvm-3.15.4
Warning: include(pdo.php): File not found in /in/Jb5Ga on line 3 Fatal error: Uncaught Error: require_once(tools/HTMLPurifier.standalone.php): File not found in /in/Jb5Ga:4 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected '?' in /in/Jb5Ga on line 5
Process exited with code 255.