3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); include('pdo.php'); $editFlag = $_POST['editFlag'] ?? false; $contentID = $_POST['id'] ?? false; $section = 1; require_once 'tools/HTMLPurifier.standalone.php'; $config = HTMLPurifier_Config::createDefault(); $purifier = new HTMLPurifier($config); $clean_html = $purifier->purify($_POST['userContent']); if ($editFlag != "1"){ $stmt = $db->prepare("INSERT INTO userContent (section, author, content) VALUES (:section, :author, :content)"); $stmt->bindValue(':section', $section, PDO::PARAM_INT); $stmt->bindValue(':author', $_SESSION['userID'], PDO::PARAM_INT); $stmt->bindValue(':content', $clean_html, PDO::PARAM_STR); $stmt->execute(); } else { $stmt = $db->prepare("UPDATE userContent SET section=:section, author=:author, content=:content WHERE id=:contentID"); $stmt->bindValue(':section', $section, PDO::PARAM_INT); $stmt->bindValue(':author', $_SESSION['userID'], PDO::PARAM_INT); $stmt->bindValue(':content', $clean_html, PDO::PARAM_STR); $stmt->bindValue(':contentID', $contentID, PDO::PARAM_INT); $stmt->execute(); } ?>
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.4, 8.3.6
Warning: include(): open_basedir restriction in effect. File(pdo.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/vnI8c on line 3 Warning: include(pdo.php): Failed to open stream: Operation not permitted in /in/vnI8c on line 3 Warning: include(): Failed opening 'pdo.php' for inclusion (include_path='.:') in /in/vnI8c 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:/etc) in /in/vnI8c on line 8 Warning: require_once(tools/HTMLPurifier.standalone.php): Failed to open stream: Operation not permitted in /in/vnI8c on line 8 Fatal error: Uncaught Error: Failed opening required 'tools/HTMLPurifier.standalone.php' (include_path='.:') in /in/vnI8c:8 Stack trace: #0 {main} thrown in /in/vnI8c on line 8
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Warning: include(): open_basedir restriction in effect. File(pdo.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/vnI8c on line 3 Warning: include(pdo.php): Failed to open stream: Operation not permitted in /in/vnI8c on line 3 Warning: include(): Failed opening 'pdo.php' for inclusion (include_path='.:') in /in/vnI8c 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:/etc) in /in/vnI8c on line 8 Warning: require_once(tools/HTMLPurifier.standalone.php): Failed to open stream: Operation not permitted in /in/vnI8c on line 8 Fatal error: Uncaught Error: Failed opening required 'tools/HTMLPurifier.standalone.php' (include_path='.:') in /in/vnI8c:8 Stack trace: #0 {main} thrown in /in/vnI8c on line 8
Process exited with code 255.
Output for 8.0.13
Warning: include(pdo.php): Failed to open stream: No such file or directory in /in/vnI8c on line 3 Warning: include(): Failed opening 'pdo.php' for inclusion (include_path='.:') in /in/vnI8c on line 3 Warning: require_once(tools/HTMLPurifier.standalone.php): Failed to open stream: No such file or directory in /in/vnI8c on line 8 Fatal error: Uncaught Error: Failed opening required 'tools/HTMLPurifier.standalone.php' (include_path='.:') in /in/vnI8c:8 Stack trace: #0 {main} thrown in /in/vnI8c on line 8
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.10, 7.2.0, 7.3.32 - 7.3.33, 7.4.33
Warning: include(pdo.php): failed to open stream: No such file or directory in /in/vnI8c on line 3 Warning: include(): Failed opening 'pdo.php' for inclusion (include_path='.:') in /in/vnI8c on line 3 Warning: require_once(tools/HTMLPurifier.standalone.php): failed to open stream: No such file or directory in /in/vnI8c on line 8 Fatal error: require_once(): Failed opening required 'tools/HTMLPurifier.standalone.php' (include_path='.:') in /in/vnI8c on line 8
Process exited with code 255.
Output for 7.2.29 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.32
Warning: include(): open_basedir restriction in effect. File(pdo.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/vnI8c on line 3 Warning: include(pdo.php): failed to open stream: Operation not permitted in /in/vnI8c on line 3 Warning: include(): Failed opening 'pdo.php' for inclusion (include_path='.:') in /in/vnI8c 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:/etc) in /in/vnI8c on line 8 Warning: require_once(tools/HTMLPurifier.standalone.php): failed to open stream: Operation not permitted in /in/vnI8c on line 8 Fatal error: require_once(): Failed opening required 'tools/HTMLPurifier.standalone.php' (include_path='.:') in /in/vnI8c on line 8
Process exited with code 255.
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/vnI8c on line 3 Warning: include(pdo.php): failed to open stream: Operation not permitted in /in/vnI8c on line 3 Warning: include(): Failed opening 'pdo.php' for inclusion (include_path='.:') in /in/vnI8c 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/vnI8c on line 8 Warning: require_once(tools/HTMLPurifier.standalone.php): failed to open stream: Operation not permitted in /in/vnI8c on line 8 Fatal error: require_once(): Failed opening required 'tools/HTMLPurifier.standalone.php' (include_path='.:') in /in/vnI8c on line 8
Process exited with code 255.

preferences:
157.07 ms | 402 KiB | 173 Q