3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); include('mysql.php'); $editFlag = $_POST['editFlag'] ?? false; $section = 1; require_once 'tools/HTMLPurifier.standalone.php'; $stmt = $link->prepare("INSERT INTO userContent (section, author, content) VALUES (?, ?, ?)"); if ($editFlag != "1"){ $config = HTMLPurifier_Config::createDefault(); $purifier = new HTMLPurifier($config); $clean_html = $purifier->purify($_POST['userContent']); $stmt->bind_param("iis", $section, $_SESSION['userID'], $clean_html); if ($stmt->execute() === TRUE) { echo '<center>Your content was added.</center>'; } else { echo "Error: " . $sql . "<br>" . $link->error; } } else { $config = HTMLPurifier_Config::createDefault(); $purifier = new HTMLPurifier($config); $clean_html = $purifier->purify($_POST['userContent']); $stmt->bind_param("iis", $section, $_SESSION['userID'], $clean_html); if ($stmt->execute() === TRUE) { } else { echo "Error: " . $sql . "<br>" . $link->error; } } ?>
Output for 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.31, 8.2.0 - 8.2.27, 8.3.0 - 8.3.15, 8.4.1 - 8.4.2
Warning: include(): open_basedir restriction in effect. File(mysql.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/mudap on line 4 Warning: include(mysql.php): Failed to open stream: Operation not permitted in /in/mudap on line 4 Warning: include(): Failed opening 'mysql.php' for inclusion (include_path='.:') in /in/mudap on line 4 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/mudap on line 9 Warning: require_once(tools/HTMLPurifier.standalone.php): Failed to open stream: Operation not permitted in /in/mudap on line 9 Fatal error: Uncaught Error: Failed opening required 'tools/HTMLPurifier.standalone.php' (include_path='.:') in /in/mudap:9 Stack trace: #0 {main} thrown in /in/mudap on line 9
Process exited with code 255.
Output for 8.0.13
Warning: include(mysql.php): Failed to open stream: No such file or directory in /in/mudap on line 4 Warning: include(): Failed opening 'mysql.php' for inclusion (include_path='.:') in /in/mudap on line 4 Warning: require_once(tools/HTMLPurifier.standalone.php): Failed to open stream: No such file or directory in /in/mudap on line 9 Fatal error: Uncaught Error: Failed opening required 'tools/HTMLPurifier.standalone.php' (include_path='.:') in /in/mudap:9 Stack trace: #0 {main} thrown in /in/mudap on line 9
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.10, 7.3.32 - 7.3.33, 7.4.33
Warning: include(mysql.php): failed to open stream: No such file or directory in /in/mudap on line 4 Warning: include(): Failed opening 'mysql.php' for inclusion (include_path='.:') in /in/mudap on line 4 Warning: require_once(tools/HTMLPurifier.standalone.php): failed to open stream: No such file or directory in /in/mudap on line 9 Fatal error: require_once(): Failed opening required 'tools/HTMLPurifier.standalone.php' (include_path='.:') in /in/mudap on line 9
Process exited with code 255.
Output for 7.1.25 - 7.1.33, 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(mysql.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/mudap on line 4 Warning: include(mysql.php): failed to open stream: Operation not permitted in /in/mudap on line 4 Warning: include(): Failed opening 'mysql.php' for inclusion (include_path='.:') in /in/mudap on line 4 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/mudap on line 9 Warning: require_once(tools/HTMLPurifier.standalone.php): failed to open stream: Operation not permitted in /in/mudap on line 9 Fatal error: require_once(): Failed opening required 'tools/HTMLPurifier.standalone.php' (include_path='.:') in /in/mudap on line 9
Process exited with code 255.
Output for 7.1.20
Warning: include(): open_basedir restriction in effect. File(mysql.php) is not within the allowed path(s): (/tmp:/in) in /in/mudap on line 4 Warning: include(mysql.php): failed to open stream: Operation not permitted in /in/mudap on line 4 Warning: include(): Failed opening 'mysql.php' for inclusion (include_path='.:') in /in/mudap on line 4 Warning: require_once(): open_basedir restriction in effect. File(tools/HTMLPurifier.standalone.php) is not within the allowed path(s): (/tmp:/in) in /in/mudap on line 9 Warning: require_once(tools/HTMLPurifier.standalone.php): failed to open stream: Operation not permitted in /in/mudap on line 9 Fatal error: require_once(): Failed opening required 'tools/HTMLPurifier.standalone.php' (include_path='.:') in /in/mudap on line 9
Process exited with code 255.

preferences:
51.32 ms | 414 KiB | 5 Q