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; $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 if($_SERVER['REQUEST_METHOD'] == 'POST') { /** * Записываем в текущую историю то, что пришло из POST['text'] * (пользователь мог изменить предыдущий результат в поле ввода текста вручную) * Если же история пуста, произойдет инициализация сессии с историей - * в сессию в $_SESSION[category][0][text] запишется POST['text'] */ $history = History::getInstance(History::CURRENT_RECORD); $history->set('text', $input->post('text')); $history->destroyInstance(); $route = $input->post('action') ? $input->post('action') : 'editor/editor/index/'; } else { $route = $input->get('route') ? $input->get('route') : 'editor/editor/index/' . $input->get('category'); } $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);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.110.0230.06812.00
5.4.100.0150.04611.99
5.4.90.0180.04111.99
5.4.80.0140.04611.99
5.4.70.0120.04711.99
5.4.60.0160.05611.99
5.4.50.0350.06911.99
5.4.40.0190.03811.98
5.4.30.0150.04711.97
5.4.20.0160.04311.97
5.4.10.0160.04211.97
5.4.00.0150.04211.46
5.3.210.0260.06812.68
5.3.200.0240.06712.68
5.3.190.0170.04512.67
5.3.180.0230.06712.67
5.3.170.0150.04512.67
5.3.160.0200.07012.68
5.3.150.0170.04712.67
5.3.140.0200.04312.66
5.3.130.0180.04612.65
5.3.120.0170.04412.65
5.3.110.0150.04612.66
5.3.100.0280.08012.12
5.3.90.0130.04412.08
5.3.80.0190.04112.07
5.3.70.0150.04612.07
5.3.60.0230.06812.06
5.3.50.0160.04612.00
5.3.40.0210.05712.00
5.3.30.0150.04211.95
5.3.20.0180.04311.72
5.3.10.0170.03911.69
5.3.00.0200.03911.67

preferences:
141.76 ms | 1394 KiB | 7 Q