3v4l.org

run code in 300+ PHP versions simultaneously
<?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);
Output for 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Warning: preg_match_all(): Compilation failed: missing closing parenthesis at offset 247 in /in/mA55J on line 40
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28
Warning: preg_match_all(): Compilation failed: missing closing parenthesis at offset 247 in /in/mA55J on line 47
Output for 5.2.2 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33
Warning: preg_match_all(): Compilation failed: missing ) at offset 247 in /in/mA55J on line 47
Output for 5.2.0 - 5.2.1
Warning: preg_match_all(): Compilation failed: unrecognized character after (?< at offset 18 in /in/mA55J on line 47
Output for 4.3.11, 4.4.0 - 4.4.1, 4.4.3 - 4.4.4, 5.0.0 - 5.0.5, 5.1.0 - 5.1.1, 5.1.3 - 5.1.6
Warning: preg_match_all(): Compilation failed: assertion expected after (?( at offset 3 in /in/mA55J on line 47 Array ( )
Output for 4.4.2, 5.1.2
Warning: preg_match_all(): Compilation failed: assertion expected after (?( at offset 3 in /in/mA55J on line 48 Array ( )
Output for 4.4.6 - 4.4.9
Warning: preg_match_all(): Compilation failed: missing ) at offset 247 in /in/mA55J on line 47 Array ( )
Output for 4.4.5
Warning: preg_match_all(): Compilation failed: unrecognized character after (?< at offset 18 in /in/mA55J on line 47 Array ( )
Output for 4.3.0 - 4.3.10
Warning: Compilation failed: assertion expected after (?( at offset 3 in /in/mA55J on line 47 Array ( )

preferences:
288.13 ms | 401 KiB | 399 Q