3v4l.org

run code in 300+ PHP versions simultaneously
<?php // SpaceBoard - the board with support for spaces // Copyright (C) 2012 GlitchMr // We have to expect PHP 4.0.0 without extensions until end of the tests. // Hack protection if (file_exists('../storage/sql.php')) { die('Please delete <kbd>storage/sql.php</kbd> to continue.'); } session_start(); if (!empty($_GET['ignore_errors'])) { $_SESSION['space_ignore_errors'] = true; } $errors = array(); // If version_compare doesn't exist then you're seriously screwed. if (!function_exists('version_compare') || version_compare(PHP_VERSION, '5.2.4', '<') ) { $errors[] = 'You\'re using PHP ' . htmlspecialchars(PHP_VERSION) . ' but you need at least PHP 5.2.4'; } if (!class_exists('mysqli')) { $errors[] = '<code>mysqli</code> not found, but it\'s required.'; } if (!function_exists('mb_strlen')) { $errors[] = 'Multibyte String for PHP is not installed. It\'s required.'; } if (!function_exists('preg_match')) { $errors[] = 'Your PHP installation doesn\'t have PCRE. It\'s required ' . 'for SpaceBoard to work.'; } if (ini_get('register_globals')) { $errors[] = 'Your server has <a href="http://www.php.net/manual/en/' . 'security.globals.php">register_globals</a> enabled. It\'s' . ' unsupported and attempting to continue may result your ' . 'board being hacked.'; } if (!file_exists('../storage/plugins')) { // Make basic file storage for tests @mkdir('../storage'); @mkdir('../storage/3rdparty'); @mkdir('../storage/3rdparty/twig'); @mkdir('../storage/plugins'); } // If it doesn't exist after creation something went wrong. if (!file_exists('../storage/plugins')) { $errors[] = 'Your filesystem isn\'t writable. Make <kbd>storage</kbd> ' . 'directory in main directory of your board and give it ' . 'read and write rights.'; } if ($errors && empty($_SESSION['space_ignore_errors'])) { echo '<!DOCTYPE html><title>Runtime error!</title>', '<div style="border-top: 5px solid red;', 'border-bottom: 5px solid red;', 'background: #FEE;', 'padding: 5px">', '<p>Sorry, but your server cannot run SpaceBoard.<ul>'; foreach ($errors as $error) { echo "<li>$error"; } echo '</ul><p>Or, if you really want to continue you may ', '<a href="?ignore_errors=1">continue</a>. You have been warned ', 'through. Don\'t complain if your installation won\'t work.</div>'; exit; } // If we are at this point that means everything should be fine. We may load // installer and write stuff without bothering about lack of compatibility. chdir('..'); require_once 'lib/basics.php'; require_once 'lib/twig.php'; require_once 'lib/i18n.php'; require_once 'lib/functions.php'; require_once 'lib/sql.php'; // Initialize $error variable. $error = null; // The board doesn't exist, but we should know the theme. $theme = 'spaceboard'; // Also, language should be set to English $lang = 'en'; $fields = array( 'dbserver' => array( 'name' => __('install_server'), 'hint' => __('install_server_hint'), 'type' => 'text', 'value' => issetor($_POST['dbserver'], 'localhost'), ), 'dbname' => array( 'name' => __('install_name'), 'type' => 'text', 'value' => issetor($_POST['dbname'], ''), ), 'dbuser' => array( 'name' => __('install_user'), 'type' => 'text', 'value' => issetor($_POST['dbuser'], ''), ), 'dbpass' => array( 'name' => __('install_password'), 'type' => 'password', 'value' => issetor($_POST['dbpass'], ''), ), 'dbprefix' => array( 'name' => __('install_prefix'), 'hint' => __('install_prefix_hint'), 'type' => 'text', 'value' => issetor($_POST['dbprefix'], 'space_'), ), 'dbport' => array( 'name' => __('install_port'), 'hint' => __('install_port_hint'), 'type' => 'number', 'value' => issetor($_POST['dbport'], 3306), ), 'submit' => array( 'name' => __('install_submit'), 'type' => 'submit', 'value' => __('install_submit_button'), ), );
Output for git.master, git.master_jit, rfc.property-hooks
Warning: file_exists(): open_basedir restriction in effect. File(../storage/sql.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/XXkfX on line 8 Warning: session_start(): Session cannot be started after headers have already been sent in /in/XXkfX on line 12 Warning: file_exists(): open_basedir restriction in effect. File(../storage/plugins) is not within the allowed path(s): (/tmp:/in:/etc) in /in/XXkfX on line 43 Warning: file_exists(): open_basedir restriction in effect. File(../storage/plugins) is not within the allowed path(s): (/tmp:/in:/etc) in /in/XXkfX on line 52 <!DOCTYPE html><title>Runtime error!</title><div style="border-top: 5px solid red;border-bottom: 5px solid red;background: #FEE;padding: 5px"><p>Sorry, but your server cannot run SpaceBoard.<ul><li><code>mysqli</code> not found, but it's required.<li>Your filesystem isn't writable. Make <kbd>storage</kbd> directory in main directory of your board and give it read and write rights.</ul><p>Or, if you really want to continue you may <a href="?ignore_errors=1">continue</a>. You have been warned through. Don't complain if your installation won't work.</div>

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
42.22 ms | 403 KiB | 8 Q