3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $code = <<<CODE require_once 'config.php'; require_once 'startup.php'; //TODO: Добавить очистку массивов POST и GET $input = new Input; $session = new Session; $cookie = new Cookie; $user = User::getInstance(); //test - admin is permanently logged in $session->set('hash', '06260034fa0ac9fef81991f93abf2db3'); //test $hash = $session->get('hash') ? $session->get('hash') : $cookie->get('hash'); $user->fetchOneByHash($hash); //Запускаем action, в зависимости от того, что пришло в POST /** * Записываем в текущую историю то, что пришло из POST['text'] * (пользователь мог изменить предыдущий результат в поле ввода текста вручную) * Если же история пуста, произойдет инициализация сессии с историей - * в сессию в $_SESSION[category][0][text] запишется POST['text'] */ $history = History::getInstance(History::CURRENT_RECORD); $history->set('text', $input->post('text')); $history->destroyInstance(); $action = new Action($route); $action->execute(); CODE; preg_match_all('~(?(DEFINE) (?<comment> (?&line_comment) | (?&block_comment)) (?<line_comment> (?&slash_comment) | (?&hash_comment)) (?<slash_comment> //.*) (?<hash_comment> #.*) (?<block_comment> (?s)/\*.*?\*/) ) (?&comment)~x', $code, $matches); print_r($matches);
Output for 7.0.0 - 7.1.0
Notice: Undefined variable: input in /in/IbDJs on line 8 Notice: Undefined variable: session in /in/IbDJs on line 9 Notice: Undefined variable: cookie in /in/IbDJs on line 10 Notice: Undefined variable: user in /in/IbDJs on line 12 Notice: Undefined variable: session in /in/IbDJs on line 15 Notice: Trying to get property of non-object in /in/IbDJs on line 15 Notice: Undefined variable: hash in /in/IbDJs on line 18 Notice: Undefined variable: session in /in/IbDJs on line 18 Notice: Trying to get property of non-object in /in/IbDJs on line 18 Notice: Undefined variable: session in /in/IbDJs on line 18 Notice: Trying to get property of non-object in /in/IbDJs on line 18 Notice: Undefined variable: cookie in /in/IbDJs on line 18 Notice: Trying to get property of non-object in /in/IbDJs on line 18 Notice: Undefined variable: user in /in/IbDJs on line 20 Notice: Trying to get property of non-object in /in/IbDJs on line 20 Notice: Undefined variable: hash in /in/IbDJs on line 20 Notice: Undefined variable: _SESSION in /in/IbDJs on line 29 Notice: Undefined variable: history in /in/IbDJs on line 31 Notice: Undefined variable: history in /in/IbDJs on line 32 Notice: Trying to get property of non-object in /in/IbDJs on line 32 Notice: Undefined variable: input in /in/IbDJs on line 32 Notice: Trying to get property of non-object in /in/IbDJs on line 32 Notice: Undefined variable: history in /in/IbDJs on line 33 Notice: Trying to get property of non-object in /in/IbDJs on line 33 Notice: Undefined variable: action in /in/IbDJs on line 35 Notice: Undefined variable: route in /in/IbDJs on line 35 Notice: Undefined variable: action in /in/IbDJs on line 36 Notice: Trying to get property of non-object in /in/IbDJs on line 36 Warning: preg_match_all(): Compilation failed: missing ) at offset 247 in /in/IbDJs on line 46
Output for 5.2.3 - 5.6.28
Notice: Undefined variable: input in /in/IbDJs on line 9 Notice: Undefined variable: session in /in/IbDJs on line 10 Notice: Undefined variable: cookie in /in/IbDJs on line 12 Notice: Undefined variable: user in /in/IbDJs on line 15 Notice: Undefined variable: session in /in/IbDJs on line 15 Notice: Trying to get property of non-object in /in/IbDJs on line 15 Notice: Undefined variable: hash in /in/IbDJs on line 18 Notice: Undefined variable: session in /in/IbDJs on line 18 Notice: Trying to get property of non-object in /in/IbDJs on line 18 Notice: Undefined variable: session in /in/IbDJs on line 18 Notice: Trying to get property of non-object in /in/IbDJs on line 18 Notice: Undefined variable: cookie in /in/IbDJs on line 18 Notice: Trying to get property of non-object in /in/IbDJs on line 18 Notice: Undefined variable: user in /in/IbDJs on line 20 Notice: Trying to get property of non-object in /in/IbDJs on line 20 Notice: Undefined variable: hash in /in/IbDJs on line 29 Notice: Undefined variable: _SESSION in /in/IbDJs on line 29 Notice: Undefined variable: history in /in/IbDJs on line 32 Notice: Undefined variable: history in /in/IbDJs on line 32 Notice: Trying to get property of non-object in /in/IbDJs on line 32 Notice: Undefined variable: input in /in/IbDJs on line 32 Notice: Trying to get property of non-object in /in/IbDJs on line 32 Notice: Undefined variable: history in /in/IbDJs on line 33 Notice: Trying to get property of non-object in /in/IbDJs on line 33 Notice: Undefined variable: action in /in/IbDJs on line 35 Notice: Undefined variable: route in /in/IbDJs on line 36 Notice: Undefined variable: action in /in/IbDJs on line 36 Notice: Trying to get property of non-object in /in/IbDJs on line 36 Warning: preg_match_all(): Compilation failed: missing ) at offset 247 in /in/IbDJs on line 46
Output for 5.2.2
Notice: Undefined variable: input in /in/IbDJs on line 8 Notice: Undefined variable: session in /in/IbDJs on line 9 Notice: Undefined variable: cookie in /in/IbDJs on line 10 Notice: Undefined variable: user in /in/IbDJs on line 12 Notice: Undefined variable: session in /in/IbDJs on line 15 Notice: Trying to get property of non-object in /in/IbDJs on line 15 Notice: Undefined variable: hash in /in/IbDJs on line 18 Notice: Undefined variable: session in /in/IbDJs on line 18 Notice: Trying to get property of non-object in /in/IbDJs on line 18 Notice: Undefined variable: session in /in/IbDJs on line 18 Notice: Trying to get property of non-object in /in/IbDJs on line 18 Notice: Undefined variable: cookie in /in/IbDJs on line 18 Notice: Trying to get property of non-object in /in/IbDJs on line 18 Notice: Undefined variable: user in /in/IbDJs on line 20 Notice: Trying to get property of non-object in /in/IbDJs on line 20 Notice: Undefined variable: hash in /in/IbDJs on line 23 Notice: Undefined variable: _SESSION in /in/IbDJs on line 29 Notice: Undefined variable: history in /in/IbDJs on line 31 Notice: Undefined variable: history in /in/IbDJs on line 32 Notice: Trying to get property of non-object in /in/IbDJs on line 32 Notice: Undefined variable: input in /in/IbDJs on line 32 Notice: Trying to get property of non-object in /in/IbDJs on line 32 Notice: Undefined variable: history in /in/IbDJs on line 33 Notice: Trying to get property of non-object in /in/IbDJs on line 33 Notice: Undefined variable: action in /in/IbDJs on line 35 Notice: Undefined variable: route in /in/IbDJs on line 36 Notice: Undefined variable: action in /in/IbDJs on line 36 Notice: Trying to get property of non-object in /in/IbDJs on line 36 Warning: preg_match_all(): Compilation failed: missing ) at offset 247 in /in/IbDJs on line 46
Output for 5.2.0 - 5.2.1
Notice: Undefined variable: input in /in/IbDJs on line 8 Notice: Undefined variable: session in /in/IbDJs on line 9 Notice: Undefined variable: cookie in /in/IbDJs on line 10 Notice: Undefined variable: user in /in/IbDJs on line 12 Notice: Undefined variable: session in /in/IbDJs on line 15 Notice: Trying to get property of non-object in /in/IbDJs on line 15 Notice: Undefined variable: hash in /in/IbDJs on line 18 Notice: Undefined variable: session in /in/IbDJs on line 18 Notice: Trying to get property of non-object in /in/IbDJs on line 18 Notice: Undefined variable: session in /in/IbDJs on line 18 Notice: Trying to get property of non-object in /in/IbDJs on line 18 Notice: Undefined variable: cookie in /in/IbDJs on line 18 Notice: Trying to get property of non-object in /in/IbDJs on line 18 Notice: Undefined variable: user in /in/IbDJs on line 20 Notice: Trying to get property of non-object in /in/IbDJs on line 20 Notice: Undefined variable: hash in /in/IbDJs on line 23 Notice: Undefined variable: _SESSION in /in/IbDJs on line 29 Notice: Undefined variable: history in /in/IbDJs on line 31 Notice: Undefined variable: history in /in/IbDJs on line 32 Notice: Trying to get property of non-object in /in/IbDJs on line 32 Notice: Undefined variable: input in /in/IbDJs on line 32 Notice: Trying to get property of non-object in /in/IbDJs on line 32 Notice: Undefined variable: history in /in/IbDJs on line 33 Notice: Trying to get property of non-object in /in/IbDJs on line 33 Notice: Undefined variable: action in /in/IbDJs on line 35 Notice: Undefined variable: route in /in/IbDJs on line 36 Notice: Undefined variable: action in /in/IbDJs on line 36 Notice: Trying to get property of non-object in /in/IbDJs on line 36 Warning: preg_match_all(): Compilation failed: unrecognized character after (?< at offset 18 in /in/IbDJs on line 46
Output for 5.0.4 - 5.1.1, 5.1.3 - 5.1.6
Notice: Undefined variable: input in /in/IbDJs on line 8 Notice: Undefined variable: session in /in/IbDJs on line 9 Notice: Undefined variable: cookie in /in/IbDJs on line 10 Notice: Undefined variable: user in /in/IbDJs on line 12 Notice: Undefined variable: session in /in/IbDJs on line 15 Notice: Trying to get property of non-object in /in/IbDJs on line 15 Notice: Undefined variable: hash in /in/IbDJs on line 18 Notice: Undefined variable: session in /in/IbDJs on line 18 Notice: Trying to get property of non-object in /in/IbDJs on line 18 Notice: Undefined variable: session in /in/IbDJs on line 18 Notice: Trying to get property of non-object in /in/IbDJs on line 18 Notice: Undefined variable: cookie in /in/IbDJs on line 18 Notice: Trying to get property of non-object in /in/IbDJs on line 18 Notice: Undefined variable: user in /in/IbDJs on line 20 Notice: Trying to get property of non-object in /in/IbDJs on line 20 Notice: Undefined variable: hash in /in/IbDJs on line 23 Notice: Undefined variable: _SESSION in /in/IbDJs on line 29 Notice: Undefined variable: history in /in/IbDJs on line 31 Notice: Undefined variable: history in /in/IbDJs on line 32 Notice: Trying to get property of non-object in /in/IbDJs on line 32 Notice: Undefined variable: input in /in/IbDJs on line 32 Notice: Trying to get property of non-object in /in/IbDJs on line 32 Notice: Undefined variable: history in /in/IbDJs on line 33 Notice: Trying to get property of non-object in /in/IbDJs on line 33 Notice: Undefined variable: action in /in/IbDJs on line 35 Notice: Undefined variable: route in /in/IbDJs on line 36 Notice: Undefined variable: action in /in/IbDJs on line 36 Notice: Trying to get property of non-object in /in/IbDJs on line 36 Warning: preg_match_all(): Compilation failed: assertion expected after (?( at offset 3 in /in/IbDJs on line 46 Array ( )
Output for 5.1.2
Notice: Undefined variable: input in /in/IbDJs on line 8 Notice: Undefined variable: session in /in/IbDJs on line 9 Notice: Undefined variable: cookie in /in/IbDJs on line 10 Notice: Undefined variable: user in /in/IbDJs on line 12 Notice: Undefined variable: session in /in/IbDJs on line 15 Notice: Trying to get property of non-object in /in/IbDJs on line 15 Notice: Undefined variable: hash in /in/IbDJs on line 18 Notice: Undefined variable: session in /in/IbDJs on line 18 Notice: Trying to get property of non-object in /in/IbDJs on line 18 Notice: Undefined variable: session in /in/IbDJs on line 18 Notice: Trying to get property of non-object in /in/IbDJs on line 18 Notice: Undefined variable: cookie in /in/IbDJs on line 18 Notice: Trying to get property of non-object in /in/IbDJs on line 18 Notice: Undefined variable: user in /in/IbDJs on line 20 Notice: Trying to get property of non-object in /in/IbDJs on line 20 Notice: Undefined variable: hash in /in/IbDJs on line 23 Notice: Undefined variable: _SESSION in /in/IbDJs on line 29 Notice: Undefined variable: history in /in/IbDJs on line 31 Notice: Undefined variable: history in /in/IbDJs on line 32 Notice: Trying to get property of non-object in /in/IbDJs on line 32 Notice: Undefined variable: input in /in/IbDJs on line 32 Notice: Trying to get property of non-object in /in/IbDJs on line 32 Notice: Undefined variable: history in /in/IbDJs on line 33 Notice: Trying to get property of non-object in /in/IbDJs on line 33 Notice: Undefined variable: action in /in/IbDJs on line 35 Notice: Undefined variable: route in /in/IbDJs on line 36 Notice: Undefined variable: action in /in/IbDJs on line 36 Notice: Trying to get property of non-object in /in/IbDJs on line 36 Warning: preg_match_all(): Compilation failed: assertion expected after (?( at offset 3 in /in/IbDJs on line 47 Array ( )
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: input in /in/IbDJs on line 8 Notice: Undefined variable: session in /in/IbDJs on line 9 Notice: Undefined variable: cookie in /in/IbDJs on line 10 Notice: Undefined variable: user in /in/IbDJs on line 12 Notice: Undefined variable: session in /in/IbDJs on line 15 Notice: Trying to get property of non-object in /in/IbDJs on line 15 Notice: Undefined variable: hash in /in/IbDJs on line 18 Notice: Undefined variable: session in /in/IbDJs on line 18 Notice: Trying to get property of non-object in /in/IbDJs on line 18 Notice: Undefined variable: session in /in/IbDJs on line 18 Notice: Trying to get property of non-object in /in/IbDJs on line 18 Notice: Undefined variable: cookie in /in/IbDJs on line 18 Notice: Trying to get property of non-object in /in/IbDJs on line 18 Notice: Undefined variable: user in /in/IbDJs on line 20 Notice: Trying to get property of non-object in /in/IbDJs on line 20 Notice: Undefined variable: hash in /in/IbDJs on line 23 Notice: Undefined variable: _SESSION in /in/IbDJs on line 29 Notice: Undefined variable: history in /in/IbDJs on line 31 Notice: Undefined variable: history in /in/IbDJs on line 32 Notice: Trying to get property of non-object in /in/IbDJs on line 32 Notice: Undefined variable: input in /in/IbDJs on line 32 Notice: Trying to get property of non-object in /in/IbDJs on line 32 Notice: Undefined variable: history in /in/IbDJs on line 33 Notice: Trying to get property of non-object in /in/IbDJs on line 33 Notice: Undefined variable: action in /in/IbDJs on line 35 Notice: Undefined variable: route in /in/IbDJs on line 36 Notice: Undefined variable: action in /in/IbDJs on line 36 Notice: Trying to get property of non-object in /in/IbDJs on line 36 Warning: preg_match_all(): Compilation failed: assertion expected after (?( at offset 3 in /in/IbDJs on line 46 Array ( )
Output for 4.4.6 - 4.4.9
Notice: Undefined variable: input in /in/IbDJs on line 8 Notice: Undefined variable: session in /in/IbDJs on line 9 Notice: Undefined variable: cookie in /in/IbDJs on line 10 Notice: Undefined variable: user in /in/IbDJs on line 12 Notice: Undefined variable: session in /in/IbDJs on line 15 Notice: Undefined variable: hash in /in/IbDJs on line 18 Notice: Undefined variable: session in /in/IbDJs on line 18 Notice: Undefined variable: session in /in/IbDJs on line 18 Notice: Undefined variable: cookie in /in/IbDJs on line 18 Notice: Undefined variable: user in /in/IbDJs on line 20 Notice: Undefined variable: hash in /in/IbDJs on line 23 Notice: Undefined variable: _SESSION in /in/IbDJs on line 29 Notice: Undefined variable: history in /in/IbDJs on line 31 Notice: Undefined variable: history in /in/IbDJs on line 32 Notice: Undefined variable: input in /in/IbDJs on line 32 Notice: Undefined variable: history in /in/IbDJs on line 33 Notice: Undefined variable: action in /in/IbDJs on line 35 Notice: Undefined variable: route in /in/IbDJs on line 36 Notice: Undefined variable: action in /in/IbDJs on line 36 Warning: preg_match_all(): Compilation failed: missing ) at offset 247 in /in/IbDJs on line 46 Array ( )
Output for 4.4.5
Notice: Undefined variable: input in /in/IbDJs on line 8 Notice: Undefined variable: session in /in/IbDJs on line 9 Notice: Undefined variable: cookie in /in/IbDJs on line 10 Notice: Undefined variable: user in /in/IbDJs on line 12 Notice: Undefined variable: session in /in/IbDJs on line 15 Notice: Undefined variable: hash in /in/IbDJs on line 18 Notice: Undefined variable: session in /in/IbDJs on line 18 Notice: Undefined variable: session in /in/IbDJs on line 18 Notice: Undefined variable: cookie in /in/IbDJs on line 18 Notice: Undefined variable: user in /in/IbDJs on line 20 Notice: Undefined variable: hash in /in/IbDJs on line 23 Notice: Undefined variable: _SESSION in /in/IbDJs on line 29 Notice: Undefined variable: history in /in/IbDJs on line 31 Notice: Undefined variable: history in /in/IbDJs on line 32 Notice: Undefined variable: input in /in/IbDJs on line 32 Notice: Undefined variable: history in /in/IbDJs on line 33 Notice: Undefined variable: action in /in/IbDJs on line 35 Notice: Undefined variable: route in /in/IbDJs on line 36 Notice: Undefined variable: action in /in/IbDJs on line 36 Warning: preg_match_all(): Compilation failed: unrecognized character after (?< at offset 18 in /in/IbDJs on line 46 Array ( )
Output for 4.3.11 - 4.4.1, 4.4.3 - 4.4.4
Notice: Undefined variable: input in /in/IbDJs on line 8 Notice: Undefined variable: session in /in/IbDJs on line 9 Notice: Undefined variable: cookie in /in/IbDJs on line 10 Notice: Undefined variable: user in /in/IbDJs on line 12 Notice: Undefined variable: session in /in/IbDJs on line 15 Notice: Undefined variable: hash in /in/IbDJs on line 18 Notice: Undefined variable: session in /in/IbDJs on line 18 Notice: Undefined variable: session in /in/IbDJs on line 18 Notice: Undefined variable: cookie in /in/IbDJs on line 18 Notice: Undefined variable: user in /in/IbDJs on line 20 Notice: Undefined variable: hash in /in/IbDJs on line 23 Notice: Undefined variable: _SESSION in /in/IbDJs on line 29 Notice: Undefined variable: history in /in/IbDJs on line 31 Notice: Undefined variable: history in /in/IbDJs on line 32 Notice: Undefined variable: input in /in/IbDJs on line 32 Notice: Undefined variable: history in /in/IbDJs on line 33 Notice: Undefined variable: action in /in/IbDJs on line 35 Notice: Undefined variable: route in /in/IbDJs on line 36 Notice: Undefined variable: action in /in/IbDJs on line 36 Warning: preg_match_all(): Compilation failed: assertion expected after (?( at offset 3 in /in/IbDJs on line 46 Array ( )
Output for 4.4.2
Notice: Undefined variable: input in /in/IbDJs on line 8 Notice: Undefined variable: session in /in/IbDJs on line 9 Notice: Undefined variable: cookie in /in/IbDJs on line 10 Notice: Undefined variable: user in /in/IbDJs on line 12 Notice: Undefined variable: session in /in/IbDJs on line 15 Notice: Undefined variable: hash in /in/IbDJs on line 18 Notice: Undefined variable: session in /in/IbDJs on line 18 Notice: Undefined variable: session in /in/IbDJs on line 18 Notice: Undefined variable: cookie in /in/IbDJs on line 18 Notice: Undefined variable: user in /in/IbDJs on line 20 Notice: Undefined variable: hash in /in/IbDJs on line 23 Notice: Undefined variable: _SESSION in /in/IbDJs on line 29 Notice: Undefined variable: history in /in/IbDJs on line 31 Notice: Undefined variable: history in /in/IbDJs on line 32 Notice: Undefined variable: input in /in/IbDJs on line 32 Notice: Undefined variable: history in /in/IbDJs on line 33 Notice: Undefined variable: action in /in/IbDJs on line 35 Notice: Undefined variable: route in /in/IbDJs on line 36 Notice: Undefined variable: action in /in/IbDJs on line 36 Warning: preg_match_all(): Compilation failed: assertion expected after (?( at offset 3 in /in/IbDJs on line 47 Array ( )
Output for 4.3.0 - 4.3.10
Notice: Undefined variable: input in /in/IbDJs on line 8 Notice: Undefined variable: session in /in/IbDJs on line 9 Notice: Undefined variable: cookie in /in/IbDJs on line 10 Notice: Undefined variable: user in /in/IbDJs on line 12 Notice: Undefined variable: session in /in/IbDJs on line 15 Notice: Undefined variable: hash in /in/IbDJs on line 18 Notice: Undefined variable: session in /in/IbDJs on line 18 Notice: Undefined variable: session in /in/IbDJs on line 18 Notice: Undefined variable: cookie in /in/IbDJs on line 18 Notice: Undefined variable: user in /in/IbDJs on line 20 Notice: Undefined variable: hash in /in/IbDJs on line 23 Notice: Undefined variable: _SESSION in /in/IbDJs on line 29 Notice: Undefined variable: history in /in/IbDJs on line 31 Notice: Undefined variable: history in /in/IbDJs on line 32 Notice: Undefined variable: input in /in/IbDJs on line 32 Notice: Undefined variable: history in /in/IbDJs on line 33 Notice: Undefined variable: action in /in/IbDJs on line 35 Notice: Undefined variable: route in /in/IbDJs on line 36 Notice: Undefined variable: action in /in/IbDJs on line 36 Warning: Compilation failed: assertion expected after (?( at offset 3 in /in/IbDJs on line 46 Array ( )