3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php ini_set("display_errors", true); ini_set("error_reporting", E_ALL ^ E_STRICT); ini_set("html_errors", true); $_structure = array(); $_post_modules = array(); $_message = array(); $_warning = array(); $_notice = array(); $_config = array(); $_locale = array(); $_route = array(); $_error = array(); $_user = array(); $_data = array(); $_sys = array(); $_uri = array(); $_start = explode(" ", microtime()); $_sys['load'][] = $_start[1] + $_start[0]; unset($_start); $_sys['root'] = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR; if ($_SERVER['SERVER_PORT'] == 80) { $_sys['protocol'] = "http"; } else { $_sys['protocol'] = "https"; } $_uri = urldecode($_SERVER['REQUEST_URI']); if ($_uri[0] == "/") { $_uri = explode("/", $_uri); $_uri = array_slice($_uri, 1); } else { $_uri[0] = null; } if ($_SERVER['HTTP_HOST'] != $_SERVER['SERVER_NAME']) { $_sys['error'] = true; $_sys['redirect'] = $_sys['protocol'] . "://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; } $_sys['index'] = "index"; $_sys['ext'] = ".php"; $_sys['template'] = "_template"; $_sys['config'] = "_inc.config"; $_sys['locale'] = "_locale"; $_sys['structure'] = "_structure"; $_sys['functions'] = "_functions"; $_sys['posts'] = "_post"; $_sys['cookies'] = "_cookie"; $_sys['core'] = "_core"; $_sys['request'] = "_request"; $_sys[404] = "_404"; $_sys['error'] = false; $_sys['access_level'] = "_public"; $_sys['include_method'] = null; require($_sys['root'] . $_sys['config'] . $_sys['ext']); if (strpos($_SERVER['HTTP_HOST'], ".")) { $_temp = explode(".", $_SERVER['HTTP_HOST']); $_temp = array_shift($_temp); } else { $_temp = $_sys['index']; } require($_sys['root'] . DIRECTORY_SEPARATOR . $_sys['locale'] . DIRECTORY_SEPARATOR . $_sys['index'] . $_sys['ext']); if (isset($_sys['locale_index'][$_temp])) { if ($_sys['locale_index'][$_temp]) { $_sys['language'] = $_temp; } else { $_sys['language'] = $_sys['index']; } } else { $_sys['language'] = $_sys['index']; } unset($_temp); require($_sys['root'] . $_sys['locale'] . DIRECTORY_SEPARATOR . $_sys['language'] . DIRECTORY_SEPARATOR . $_sys['index'] . $_sys['ext']); require($_sys['root'] . $_sys['structure'] . DIRECTORY_SEPARATOR . $_sys['language'] . DIRECTORY_SEPARATOR . $_sys['index'] . $_sys['ext']); $_structure_reverse[] = array_flip($_structure[0]); require($_sys['root'] . $_sys['functions'] . DIRECTORY_SEPARATOR . $_sys['index'] . $_sys['ext']); //cookie operations if (!empty($_COOKIE)) { require($_sys['root'] . $_sys['cookies'] . DIRECTORY_SEPARATOR . $_sys['index'] . $_sys['ext']); } //core operations if (!$_sys['error'] && !isset($_sys['redirect'])) { $_data['html']['title'] = null; $_data['html']['meta']['keywords'] = null; $_data['html']['meta']['description'] = null; foreach ($_uri AS $_uri_index => $_uri_value) { if (isset($_structure[$_uri_index][$_uri_value])) { $_route[$_uri_index] = $_structure[$_uri_index][$_uri_value]; } else { if (!empty($_uri[$_uri_index])) { $_route[$_uri_index] = $_sys['request']; } else { $_route[$_uri_index] = $_sys['index']; } } $_sys['include_method'] .= $_sys['core'] . DIRECTORY_SEPARATOR . $_route[$_uri_index] . DIRECTORY_SEPARATOR; require($_sys['root'] . $_sys['include_method'] . $_sys['structure'] . DIRECTORY_SEPARATOR . $_sys['language'] . DIRECTORY_SEPARATOR . $_sys['index'] . $_sys['ext']); require($_sys['root'] . $_sys['include_method'] . $_sys['functions'] . DIRECTORY_SEPARATOR . $_sys['index'] . $_sys['ext']); require($_sys['root'] . $_sys['include_method'] . $_sys['index'] . $_sys['ext']); if ($_sys['error']) { unset($_route[$_uri_index]);//TODO analysis $_sys['redirect'] = null; foreach ($_route AS $_route_key => $_route_value) { $_sys['redirect'] .= "/" . $_uri[$_route_key]; } } else { if (isset($_structure[$_uri_index][$_uri_value])) { $_data['html']['title'] .= (empty($_data['html']['title']) ? null : " :: ") . ucfirst($_uri_value); $_data['html']['meta']['keywords'] = ucfirst($_uri_value) . ", "; $_data['html']['meta']['description'] = ucfirst($_uri_value) . " "; } } } } //post operations if (!$_sys['error'] && !isset($_sys['redirect']) && $_SERVER['REQUEST_METHOD'] == "POST" && !empty($_POST)) { require($_sys['root'] . $_sys['include_method'] . $_sys['posts'] . DIRECTORY_SEPARATOR . $_sys['index'] . $_sys['ext']); foreach ($_POST as $_post_key => $_post_value) { if (isset($_config['modules'][$_post_key]) && $_config['modules'][$_post_key] && isset($_post_modules[$_post_key]) && isset($_post_modules[$_post_key][$_post_value]) && $_post_modules[$_post_key][$_post_value] == true) { require($_sys['root'] . $_sys['include_method'] . $_sys['posts'] . DIRECTORY_SEPARATOR . $_post_key . DIRECTORY_SEPARATOR . $_sys['index'] . $_sys['ext']); } } } //template or error/redirect operations if (!$_sys['error'] && !isset($_sys['redirect'])) { require($_sys['root'] . $_sys['template'] . DIRECTORY_SEPARATOR . $_sys['index'] . $_sys['ext']); } else { require($_sys['root'] . $_sys[404] . $_sys['ext']); } //developer if ($_SERVER['REMOTE_ADDR'] == "178.56.111.0") { echo "<html><body><hr>debug (" . (memory_get_peak_usage() / 1024) . "KB)<hr><pre>"; print_r(get_required_files()); print_r(get_defined_vars()); //print_r(get_defined_constants()); echo "</pre></body></html>"; } ?>
based on 2pfMl
Output for 7.2.6
<br /> <b>Notice</b>: Undefined index: SERVER_PORT in <b>/in/vFLEM</b> on line <b>22</b><br /> <br /> <b>Notice</b>: Undefined index: REQUEST_URI in <b>/in/vFLEM</b> on line <b>27</b><br /> <br /> <b>Notice</b>: Uninitialized string offset: 0 in <b>/in/vFLEM</b> on line <b>28</b><br /> <br /> <b>Warning</b>: Cannot assign an empty string to a string offset in <b>/in/vFLEM</b> on line <b>32</b><br /> <br /> <b>Notice</b>: Undefined index: HTTP_HOST in <b>/in/vFLEM</b> on line <b>34</b><br /> <br /> <b>Notice</b>: Undefined index: SERVER_NAME in <b>/in/vFLEM</b> on line <b>34</b><br /> <br /> <b>Warning</b>: require(): open_basedir restriction in effect. File(/_inc.config.php) is not within the allowed path(s): (/tmp:/in) in <b>/in/vFLEM</b> on line <b>53</b><br /> <br /> <b>Warning</b>: require(/_inc.config.php): failed to open stream: Operation not permitted in <b>/in/vFLEM</b> on line <b>53</b><br /> <br /> <b>Fatal error</b>: require(): Failed opening required '/_inc.config.php' (include_path='.:') in <b>/in/vFLEM</b> on line <b>53</b><br />
Process exited with code 255.
Output for 7.1.10 - 7.2.0
<br /> <b>Notice</b>: Undefined index: SERVER_PORT in <b>/in/vFLEM</b> on line <b>22</b><br /> <br /> <b>Notice</b>: Undefined index: REQUEST_URI in <b>/in/vFLEM</b> on line <b>27</b><br /> <br /> <b>Notice</b>: Uninitialized string offset: 0 in <b>/in/vFLEM</b> on line <b>28</b><br /> <br /> <b>Warning</b>: Cannot assign an empty string to a string offset in <b>/in/vFLEM</b> on line <b>32</b><br /> <br /> <b>Notice</b>: Undefined index: HTTP_HOST in <b>/in/vFLEM</b> on line <b>34</b><br /> <br /> <b>Notice</b>: Undefined index: SERVER_NAME in <b>/in/vFLEM</b> on line <b>34</b><br /> <br /> <b>Warning</b>: require(/_inc.config.php): failed to open stream: No such file or directory in <b>/in/vFLEM</b> on line <b>53</b><br /> <br /> <b>Fatal error</b>: require(): Failed opening required '/_inc.config.php' (include_path='.:') in <b>/in/vFLEM</b> on line <b>53</b><br />
Process exited with code 255.
Output for 7.1.0 - 7.1.7
<br /> <b>Notice</b>: Undefined index: SERVER_PORT in <b>/in/vFLEM</b> on line <b>22</b><br /> <br /> <b>Notice</b>: Undefined index: REQUEST_URI in <b>/in/vFLEM</b> on line <b>27</b><br /> <br /> <b>Notice</b>: Uninitialized string offset: 0 in <b>/in/vFLEM</b> on line <b>28</b><br /> <br /> <b>Warning</b>: Cannot assign an empty string to a string offset in <b>/in/vFLEM</b> on line <b>32</b><br /> <br /> <b>Notice</b>: Undefined index: HTTP_HOST in <b>/in/vFLEM</b> on line <b>34</b><br /> <br /> <b>Notice</b>: Undefined index: SERVER_NAME in <b>/in/vFLEM</b> on line <b>34</b><br /> <br /> <b>Warning</b>: require(): open_basedir restriction in effect. File(/_inc.config.php) is not within the allowed path(s): (/tmp/) in <b>/in/vFLEM</b> on line <b>53</b><br /> <br /> <b>Warning</b>: require(/_inc.config.php): failed to open stream: Operation not permitted in <b>/in/vFLEM</b> on line <b>53</b><br /> <br /> <b>Fatal error</b>: require(): Failed opening required '/_inc.config.php' (include_path='.:') in <b>/in/vFLEM</b> on line <b>53</b><br />
Process exited with code 255.
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.0.20
<br /> <b>Notice</b>: Undefined index: SERVER_PORT in <b>/in/vFLEM</b> on line <b>22</b><br /> <br /> <b>Notice</b>: Undefined index: REQUEST_URI in <b>/in/vFLEM</b> on line <b>27</b><br /> <br /> <b>Notice</b>: Uninitialized string offset: 0 in <b>/in/vFLEM</b> on line <b>28</b><br /> <br /> <b>Notice</b>: Undefined index: HTTP_HOST in <b>/in/vFLEM</b> on line <b>34</b><br /> <br /> <b>Notice</b>: Undefined index: SERVER_NAME in <b>/in/vFLEM</b> on line <b>34</b><br /> <br /> <b>Warning</b>: require(): open_basedir restriction in effect. File(/_inc.config.php) is not within the allowed path(s): (/tmp/) in <b>/in/vFLEM</b> on line <b>53</b><br /> <br /> <b>Warning</b>: require(/_inc.config.php): failed to open stream: Operation not permitted in <b>/in/vFLEM</b> on line <b>53</b><br /> <br /> <b>Fatal error</b>: require(): Failed opening required '/_inc.config.php' (include_path='.:') in <b>/in/vFLEM</b> on line <b>53</b><br />
Process exited with code 255.
Output for hhvm-3.15.4
Notice: Undefined index: SERVER_PORT in /in/vFLEM on line 22 Notice: Undefined index: REQUEST_URI in /in/vFLEM on line 27 Warning: urldecode() expects parameter 1 to be string, null given in /in/vFLEM on line 27 Notice: Undefined index: HTTP_HOST in /in/vFLEM on line 34 Notice: Undefined index: SERVER_NAME in /in/vFLEM on line 34 Fatal error: Uncaught Error: require(/_inc.config.php): File not found in /in/vFLEM:53 Stack trace: #0 {main}
Process exited with code 255.