<?php
$code = <<<CODE
require_once 'config.php';
require_once 'startup.php';
//TODO: Добавить очистку массивов POST и GET
\$input = new Input;
\$session = new Session;
\$cookie = new Cookie;
# hashcomment
\$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);
Warning: Undefined variable $hash in /in/8Bh0D on line 21
Warning: Undefined global variable $_SESSION in /in/8Bh0D on line 30
Warning: Trying to access array offset on null in /in/8Bh0D on line 30
Warning: Undefined variable $input in /in/8Bh0D on line 33
Warning: Attempt to read property "post" on null in /in/8Bh0D on line 33
Warning: Undefined variable $route in /in/8Bh0D on line 36
Warning: preg_match_all(): Compilation failed: missing closing parenthesis at offset 247 in /in/8Bh0D on line 40
Output for 8.2.0 - 8.2.18
Warning: Undefined variable $hash in /in/8Bh0D on line 21
Warning: Undefined global variable $_SESSION in /in/8Bh0D on line 30
Warning: Trying to access array offset on value of type null in /in/8Bh0D on line 30
Warning: Undefined variable $input in /in/8Bh0D on line 33
Warning: Attempt to read property "post" on null in /in/8Bh0D on line 33
Warning: Undefined variable $route in /in/8Bh0D on line 36
Warning: preg_match_all(): Compilation failed: missing closing parenthesis at offset 247 in /in/8Bh0D on line 40
Output for 8.1.0 - 8.1.28
Warning: Undefined variable $hash in /in/8Bh0D on line 21
Warning: Undefined global variable $_SESSION in /in/8Bh0D on line 30
Warning: Trying to access array offset on value of type null in /in/8Bh0D on line 30
Warning: Undefined variable $input in /in/8Bh0D on line 33
Warning: Attempt to read property "post" on null in /in/8Bh0D on line 33
Warning: Undefined variable $route in /in/8Bh0D on line 36
Warning: preg_match_all(): Compilation failed: missing closing parenthesis at offset 247 in /in/8Bh0D on line 47
Output for 8.0.0 - 8.0.30
Warning: Undefined variable $hash in /in/8Bh0D on line 21
Warning: Undefined variable $_SESSION in /in/8Bh0D on line 30
Warning: Trying to access array offset on value of type null in /in/8Bh0D on line 30
Warning: Undefined variable $input in /in/8Bh0D on line 33
Warning: Attempt to read property "post" on null in /in/8Bh0D on line 33
Warning: Undefined variable $route in /in/8Bh0D on line 36
Warning: preg_match_all(): Compilation failed: missing closing parenthesis at offset 247 in /in/8Bh0D on line 47
Output for 7.4.0 - 7.4.25, 7.4.27 - 7.4.33
Notice: Undefined variable: hash in /in/8Bh0D on line 21
Notice: Undefined variable: _SESSION in /in/8Bh0D on line 30
Notice: Trying to access array offset on value of type null in /in/8Bh0D on line 30
Notice: Undefined variable: input in /in/8Bh0D on line 33
Notice: Trying to get property 'post' of non-object in /in/8Bh0D on line 33
Notice: Undefined variable: route in /in/8Bh0D on line 36
Warning: preg_match_all(): Compilation failed: missing closing parenthesis at offset 247 in /in/8Bh0D on line 47
Output for 7.3.32 - 7.3.33, 7.4.26
Warning: preg_match_all(): Compilation failed: missing closing parenthesis at offset 247 in /in/8Bh0D on line 47
Output for 7.3.12 - 7.3.31
Notice: Undefined variable: hash in /in/8Bh0D on line 21
Notice: Undefined variable: _SESSION in /in/8Bh0D on line 30
Notice: Undefined variable: input in /in/8Bh0D on line 33
Notice: Trying to get property 'post' of non-object in /in/8Bh0D on line 33
Notice: Undefined variable: route in /in/8Bh0D on line 36
Warning: preg_match_all(): Compilation failed: missing closing parenthesis at offset 247 in /in/8Bh0D on line 47
Output for 7.2.6 - 7.2.33
Notice: Undefined variable: hash in /in/8Bh0D on line 21
Notice: Undefined variable: _SESSION in /in/8Bh0D on line 30
Notice: Undefined variable: input in /in/8Bh0D on line 33
Notice: Trying to get property 'post' of non-object in /in/8Bh0D on line 33
Notice: Undefined variable: route in /in/8Bh0D on line 36
Warning: preg_match_all(): Compilation failed: missing ) at offset 247 in /in/8Bh0D on line 47
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20
Notice: Undefined variable: hash in /in/8Bh0D on line 21
Notice: Undefined variable: _SESSION in /in/8Bh0D on line 30
Notice: Undefined variable: input in /in/8Bh0D on line 33
Notice: Trying to get property of non-object in /in/8Bh0D on line 33
Notice: Undefined variable: route in /in/8Bh0D on line 36
Warning: preg_match_all(): Compilation failed: missing ) at offset 247 in /in/8Bh0D on line 47
Notice: Undefined variable: hash in /in/8Bh0D on line 30
Notice: Undefined variable: _SESSION in /in/8Bh0D on line 30
Notice: Undefined variable: input in /in/8Bh0D on line 33
Notice: Trying to get property of non-object in /in/8Bh0D on line 33
Notice: Undefined variable: route in /in/8Bh0D on line 37
Warning: preg_match_all(): Compilation failed: missing ) at offset 247 in /in/8Bh0D on line 47
Output for 5.2.2
Notice: Undefined variable: hash in /in/8Bh0D on line 24
Notice: Undefined variable: _SESSION in /in/8Bh0D on line 30
Notice: Undefined variable: input in /in/8Bh0D on line 33
Notice: Trying to get property of non-object in /in/8Bh0D on line 33
Notice: Undefined variable: route in /in/8Bh0D on line 37
Warning: preg_match_all(): Compilation failed: missing ) at offset 247 in /in/8Bh0D on line 47
Output for 5.2.0 - 5.2.1
Notice: Undefined variable: hash in /in/8Bh0D on line 24
Notice: Undefined variable: _SESSION in /in/8Bh0D on line 30
Notice: Undefined variable: input in /in/8Bh0D on line 33
Notice: Trying to get property of non-object in /in/8Bh0D on line 33
Notice: Undefined variable: route in /in/8Bh0D on line 37
Warning: preg_match_all(): Compilation failed: unrecognized character after (?< at offset 18 in /in/8Bh0D on line 47
Notice: Undefined variable: hash in /in/8Bh0D on line 24
Notice: Undefined variable: _SESSION in /in/8Bh0D on line 30
Notice: Undefined variable: input in /in/8Bh0D on line 33
Notice: Trying to get property of non-object in /in/8Bh0D on line 33
Notice: Undefined variable: route in /in/8Bh0D on line 37
Warning: preg_match_all(): Compilation failed: assertion expected after (?( at offset 3 in /in/8Bh0D on line 47
Array
(
)
Output for 5.1.2
Notice: Undefined variable: hash in /in/8Bh0D on line 24
Notice: Undefined variable: _SESSION in /in/8Bh0D on line 30
Notice: Undefined variable: input in /in/8Bh0D on line 33
Notice: Trying to get property of non-object in /in/8Bh0D on line 33
Notice: Undefined variable: route in /in/8Bh0D on line 37
Warning: preg_match_all(): Compilation failed: assertion expected after (?( at offset 3 in /in/8Bh0D on line 48
Array
(
)
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: hash in /in/8Bh0D on line 24
Notice: Undefined variable: _SESSION in /in/8Bh0D on line 30
Notice: Undefined variable: input in /in/8Bh0D on line 33
Notice: Trying to get property of non-object in /in/8Bh0D on line 33
Notice: Undefined variable: route in /in/8Bh0D on line 37
Warning: preg_match_all(): Compilation failed: assertion expected after (?( at offset 3 in /in/8Bh0D on line 47
Array
(
)
Output for 4.4.6 - 4.4.9
Notice: Undefined variable: hash in /in/8Bh0D on line 24
Notice: Undefined variable: _SESSION in /in/8Bh0D on line 30
Notice: Undefined variable: input in /in/8Bh0D on line 33
Notice: Undefined variable: route in /in/8Bh0D on line 37
Warning: preg_match_all(): Compilation failed: missing ) at offset 247 in /in/8Bh0D on line 47
Array
(
)
Output for 4.4.5
Notice: Undefined variable: hash in /in/8Bh0D on line 24
Notice: Undefined variable: _SESSION in /in/8Bh0D on line 30
Notice: Undefined variable: input in /in/8Bh0D on line 33
Notice: Undefined variable: route in /in/8Bh0D on line 37
Warning: preg_match_all(): Compilation failed: unrecognized character after (?< at offset 18 in /in/8Bh0D on line 47
Array
(
)
Output for 4.3.11, 4.4.0 - 4.4.1, 4.4.3 - 4.4.4
Notice: Undefined variable: hash in /in/8Bh0D on line 24
Notice: Undefined variable: _SESSION in /in/8Bh0D on line 30
Notice: Undefined variable: input in /in/8Bh0D on line 33
Notice: Undefined variable: route in /in/8Bh0D on line 37
Warning: preg_match_all(): Compilation failed: assertion expected after (?( at offset 3 in /in/8Bh0D on line 47
Array
(
)
Output for 4.4.2
Notice: Undefined variable: hash in /in/8Bh0D on line 24
Notice: Undefined variable: _SESSION in /in/8Bh0D on line 30
Notice: Undefined variable: input in /in/8Bh0D on line 33
Notice: Undefined variable: route in /in/8Bh0D on line 37
Warning: preg_match_all(): Compilation failed: assertion expected after (?( at offset 3 in /in/8Bh0D on line 48
Array
(
)
Output for 4.3.0 - 4.3.10
Notice: Undefined variable: hash in /in/8Bh0D on line 24
Notice: Undefined variable: _SESSION in /in/8Bh0D on line 30
Notice: Undefined variable: input in /in/8Bh0D on line 33
Notice: Undefined variable: route in /in/8Bh0D on line 37
Warning: Compilation failed: assertion expected after (?( at offset 3 in /in/8Bh0D on line 47
Array
(
)