3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * * @package ucp * @version $Id$ * @copyright (c) 2005 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ /** * @ignore */ define('IN_PHPBB', true); $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); require($phpbb_root_path . 'common.' . $phpEx); require($phpbb_root_path . 'includes/functions_user.' . $phpEx); require($phpbb_root_path . 'includes/functions_module.' . $phpEx); // Basic parameter data $id = request_var('i', ''); $mode = request_var('mode', ''); if (in_array($mode, array('login', 'logout', 'confirm', 'sendpassword', 'activate'))) { define('IN_LOGIN', true); } // Start session management $user->session_begin(); $auth->acl($user->data); $user->setup('ucp'); // Setting a variable to let the style designer know where he is... $template->assign_var('S_IN_UCP', true); $module = new p_master(); $default = false; // Basic "global" modes switch ($mode) { case 'activate': $module->load('ucp', 'activate'); $module->display($user->lang['UCP_ACTIVATE']); redirect(append_sid("{$phpbb_root_path}index.$phpEx")); break; case 'resend_act': $module->load('ucp', 'resend'); $module->display($user->lang['UCP_RESEND']); break; case 'sendpassword': $module->load('ucp', 'remind'); $module->display($user->lang['UCP_REMIND']); break; case 'register': if ($user->data['is_registered'] || isset($_REQUEST['not_agreed'])) { redirect(append_sid("{$phpbb_root_path}index.$phpEx")); } $module->load('ucp', 'register'); $module->display($user->lang['REGISTER']); break; case 'confirm': $module->load('ucp', 'confirm'); break; case 'login': if ($user->data['is_registered']) { redirect(append_sid("{$phpbb_root_path}index.$phpEx")); } login_box(request_var('redirect', "index.$phpEx")); break; case 'logout': if ($user->data['user_id'] != ANONYMOUS && isset($_GET['sid']) && !is_array($_GET['sid']) && $_GET['sid'] === $user->session_id) { $user->session_kill(); $user->session_begin(); $message = $user->lang['LOGOUT_REDIRECT']; } else { $message = ($user->data['user_id'] == ANONYMOUS) ? $user->lang['LOGOUT_REDIRECT'] : $user->lang['LOGOUT_FAILED']; } meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx")); $message = $message . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a> '); trigger_error($message); break; case 'terms': case 'privacy': $message = ($mode == 'terms') ? 'TERMS_OF_USE_CONTENT' : 'PRIVACY_POLICY'; $title = ($mode == 'terms') ? 'TERMS_USE' : 'PRIVACY'; if (empty($user->lang[$message])) { if ($user->data['is_registered']) { redirect(append_sid("{$phpbb_root_path}index.$phpEx")); } login_box(); } $template->set_filenames(array( 'body' => 'ucp_agreement.html') ); // Disable online list page_header($user->lang[$title], false); $template->assign_vars(array( 'S_AGREEMENT' => true, 'AGREEMENT_TITLE' => $user->lang[$title], 'AGREEMENT_TEXT' => sprintf($user->lang[$message], $config['sitename'], generate_board_url()), 'U_BACK' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'), 'L_BACK' => $user->lang['BACK_TO_LOGIN'], )); page_footer(); break; case 'delete_cookies': // Delete Cookies with dynamic names (do NOT delete poll cookies) if (confirm_box(true)) { $set_time = time() - 31536000; foreach ($_COOKIE as $cookie_name => $cookie_data) { // Only delete board cookies, no other ones... if (strpos($cookie_name, $config['cookie_name'] . '_') !== 0) { continue; } $cookie_name = str_replace($config['cookie_name'] . '_', '', $cookie_name); // Polls are stored as {cookie_name}_poll_{topic_id}, cookie_name_ got removed, therefore checking for poll_ if (strpos($cookie_name, 'poll_') !== 0) { $user->set_cookie($cookie_name, '', $set_time); } } $user->set_cookie('track', '', $set_time); $user->set_cookie('u', '', $set_time); $user->set_cookie('k', '', $set_time); $user->set_cookie('sid', '', $set_time); // We destroy the session here, the user will be logged out nevertheless $user->session_kill(); $user->session_begin(); meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx")); $message = $user->lang['COOKIES_DELETED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>'); trigger_error($message); } else { confirm_box(false, 'DELETE_COOKIES', ''); } redirect(append_sid("{$phpbb_root_path}index.$phpEx")); break; case 'switch_perm': $user_id = request_var('u', 0); $sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id = ' . (int) $user_id; $result = $db->sql_query($sql); $user_row = $db->sql_fetchrow($result); $db->sql_freeresult($result); if (!$auth->acl_get('a_switchperm') || !$user_row || $user_id == $user->data['user_id'] || !check_link_hash(request_var('hash', ''), 'switchperm')) { redirect(append_sid("{$phpbb_root_path}index.$phpEx")); } include($phpbb_root_path . 'includes/acp/auth.' . $phpEx); $auth_admin = new auth_admin(); if (!$auth_admin->ghost_permissions($user_id, $user->data['user_id'])) { redirect(append_sid("{$phpbb_root_path}index.$phpEx")); } add_log('admin', 'LOG_ACL_TRANSFER_PERMISSIONS', $user_row['username']); $message = sprintf($user->lang['PERMISSIONS_TRANSFERRED'], $user_row['username']) . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>'); trigger_error($message); break; case 'restore_perm': if (!$user->data['user_perm_from'] || !$auth->acl_get('a_switchperm')) { redirect(append_sid("{$phpbb_root_path}index.$phpEx")); } $auth->acl_cache($user->data); $sql = 'SELECT username FROM ' . USERS_TABLE . ' WHERE user_id = ' . $user->data['user_perm_from']; $result = $db->sql_query($sql); $username = $db->sql_fetchfield('username'); $db->sql_freeresult($result); add_log('admin', 'LOG_ACL_RESTORE_PERMISSIONS', $username); $message = $user->lang['PERMISSIONS_RESTORED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>'); trigger_error($message); break; default: $default = true; break; } // We use this approach because it does not impose large code changes if (!$default) { return true; } // Only registered users can go beyond this point if (!$user->data['is_registered']) { if ($user->data['is_bot']) { redirect(append_sid("{$phpbb_root_path}index.$phpEx")); } if ($id == 'pm' && $mode == 'view' && isset($_GET['p'])) { $redirect_url = append_sid("{$phpbb_root_path}ucp.$phpEx?i=pm&p=" . request_var('p', 0)); login_box($redirect_url, $user->lang['LOGIN_EXPLAIN_UCP']); } login_box('', $user->lang['LOGIN_EXPLAIN_UCP']); } // Instantiate module system and generate list of available modules $module->list_modules('ucp'); // Check if the zebra module is set if ($module->is_active('zebra', 'friends')) { // Output listing of friends online $update_time = $config['load_online_time'] * 60; $sql = $db->sql_build_query('SELECT_DISTINCT', array( 'SELECT' => 'u.user_id, u.username, u.username_clean, u.user_colour, MAX(s.session_time) as online_time, MIN(s.session_viewonline) AS viewonline', 'FROM' => array( USERS_TABLE => 'u', ZEBRA_TABLE => 'z' ), 'LEFT_JOIN' => array( array( 'FROM' => array(SESSIONS_TABLE => 's'), 'ON' => 's.session_user_id = z.zebra_id' ) ), 'WHERE' => 'z.user_id = ' . $user->data['user_id'] . ' AND z.friend = 1 AND u.user_id = z.zebra_id', 'GROUP_BY' => 'z.zebra_id, u.user_id, u.username_clean, u.user_colour, u.username', 'ORDER_BY' => 'u.username_clean ASC', )); $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { $which = (time() - $update_time < $row['online_time'] && ($row['viewonline'] || $auth->acl_get('u_viewonline'))) ? 'online' : 'offline'; $template->assign_block_vars("friends_{$which}", array( 'USER_ID' => $row['user_id'], 'U_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']), 'USER_COLOUR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']), 'USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']), 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'])) ); } $db->sql_freeresult($result); } // Do not display subscribed topics/forums if not allowed if (!$config['allow_topic_notify'] && !$config['allow_forum_notify']) { $module->set_display('main', 'subscribed', false); } // Do not display signature panel if not authed to do so if (!$auth->acl_get('u_sig')) { $module->set_display('profile', 'signature', false); } // Select the active module $module->set_active($id, $mode); // Load and execute the relevant module $module->load_active(); // Assign data to the template engine for the list of modules $module->assign_tpl_vars(append_sid("{$phpbb_root_path}ucp.$phpEx")); // Generate the page, do not display/query online list $module->display($module->get_page_title(), false); /** * Function for assigning a template var if the zebra module got included */ function _module_zebra($mode, &$module_row) { global $template; $template->assign_var('S_ZEBRA_ENABLED', true); if ($mode == 'friends') { $template->assign_var('S_ZEBRA_FRIENDS_ENABLED', true); } if ($mode == 'foes') { $template->assign_var('S_ZEBRA_FOES_ENABLED', true); } } ?>

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)
8.3.60.0070.01418.68
8.3.50.0130.00521.27
8.3.40.0130.00319.04
8.3.30.0120.00319.32
8.3.20.0060.00320.46
8.3.10.0080.00021.91
8.3.00.0060.00322.45
8.2.180.0100.01318.38
8.2.170.0110.00419.19
8.2.160.0150.00022.96
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00019.54
8.2.110.0060.00321.95
8.2.100.0060.00619.53
8.2.90.0000.00819.49
8.2.80.0060.00318.18
8.2.70.0030.00617.88
8.2.60.0030.00518.13
8.2.50.0060.00618.07
8.2.40.0060.00318.47
8.2.30.0030.00518.23
8.2.20.0000.00817.85
8.2.10.0030.00617.96
8.2.00.0080.00018.04
8.1.280.0110.00425.92
8.1.270.0090.00020.40
8.1.260.0000.00826.35
8.1.250.0090.00028.09
8.1.240.0050.00523.97
8.1.230.0110.00019.36
8.1.220.0040.00417.78
8.1.210.0030.00618.77
8.1.200.0070.00317.72
8.1.190.0040.00417.79
8.1.180.0050.00319.11
8.1.170.0060.00318.62
8.1.160.0040.00422.30
8.1.150.0050.00218.80
8.1.140.0060.00317.60
8.1.130.0070.00018.11
8.1.120.0080.00017.68
8.1.110.0040.00417.69
8.1.100.0000.00717.63
8.1.90.0040.00417.68
8.1.80.0030.00517.56
8.1.70.0000.00717.57
8.1.60.0050.00317.84
8.1.50.0000.00817.82
8.1.40.0000.00817.84
8.1.30.0050.00317.97
8.1.20.0060.00317.98
8.1.10.0040.00417.93
8.1.00.0000.00817.77
8.0.300.0080.00018.77
8.0.290.0040.00417.41
8.0.280.0040.00418.66
8.0.270.0040.00417.56
8.0.260.0030.00617.19
8.0.250.0000.00717.21
8.0.240.0040.00417.34
8.0.230.0000.00817.29
8.0.220.0040.00417.26
8.0.210.0030.00317.25
8.0.200.0000.00717.21
8.0.190.0050.00317.24
8.0.180.0040.00717.32
8.0.170.0080.00017.36
8.0.160.0000.00817.29
8.0.150.0100.00017.10
8.0.140.0030.00517.20
8.0.130.0030.00313.75
8.0.120.0080.00017.19
8.0.110.0040.00417.18
8.0.100.0000.00817.17
8.0.90.0030.00517.32
8.0.80.0160.00717.14
8.0.70.0060.00317.10
8.0.60.0000.00817.29
8.0.50.0000.00817.14
8.0.30.0090.01217.47
8.0.20.0130.00917.55
8.0.10.0030.00517.23
8.0.00.0080.01316.93
7.4.330.0030.00315.00
7.4.320.0000.00716.75
7.4.300.0000.00716.76
7.4.290.0030.00316.75
7.4.280.0000.00816.75
7.4.270.0050.00216.65
7.4.260.0080.00416.84
7.4.250.0040.00416.72
7.4.240.0050.00216.84
7.4.230.0030.00316.82
7.4.220.0090.01216.95
7.4.210.0100.00816.72
7.4.200.0040.00416.86
7.4.190.0000.00716.83
7.4.160.0070.01016.68
7.4.150.0110.00717.40
7.4.140.0110.01017.86
7.4.130.0050.01316.79
7.4.120.0110.01116.75
7.4.110.0040.01517.00
7.4.100.0070.01316.77
7.4.90.0160.01016.91
7.4.80.0150.00619.39
7.4.70.0160.00616.70
7.4.60.0110.00616.81
7.4.50.0030.00316.88
7.4.40.0130.00322.77
7.4.30.0100.00716.90
7.4.00.0070.00915.43
7.3.330.0000.00613.64
7.3.320.0050.00313.54
7.3.310.0030.00516.48
7.3.300.0050.00216.63
7.3.290.0090.01216.61
7.3.280.0110.00716.58
7.3.270.0120.00617.40
7.3.260.0090.00916.93
7.3.250.0100.01116.67
7.3.240.0120.00916.59
7.3.230.0660.00816.59
7.3.210.0180.00016.63
7.3.200.0090.01419.39
7.3.190.0090.01216.75
7.3.180.0130.00316.61
7.3.170.0110.00716.78
7.3.160.0070.01016.79
7.3.120.0060.01115.03
7.3.110.0130.00314.90
7.3.100.0030.01015.09
7.3.90.0040.00815.17
7.3.80.0070.01015.08
7.3.70.0040.00815.10
7.3.60.0070.00714.87
7.3.50.0130.00314.80
7.3.40.0100.01014.89
7.3.30.0030.00915.04
7.3.20.0090.00616.77
7.3.10.0030.01316.62
7.3.00.0030.00716.67
7.2.330.0090.00916.84
7.2.320.0070.01116.87
7.2.310.0090.01517.03
7.2.300.0100.00716.89
7.2.290.0130.00316.84
7.2.250.0060.01314.95
7.2.240.0140.00715.45
7.2.230.0090.00915.44
7.2.220.0030.01015.35
7.2.210.0150.00315.32
7.2.200.0040.01115.38
7.2.190.0070.01015.19
7.2.180.0060.00615.32
7.2.170.0030.01015.32
7.2.00.0150.01818.82
7.1.330.0040.01115.70
7.1.320.0080.00015.98
7.1.310.0060.00915.71
7.1.300.0030.01315.76
7.1.290.0090.00915.90
7.1.280.0030.00615.87
7.1.270.0070.01015.57
7.1.260.0000.01415.80
7.1.200.0040.00715.50
7.1.100.0130.00717.91
7.1.70.0030.00617.02
7.1.60.0100.01319.82
7.1.50.0090.00916.59
7.1.00.0070.03322.38
7.0.200.0000.01016.76
7.0.140.0000.07721.93
7.0.100.0300.04320.13
7.0.90.0370.07720.20
7.0.80.0370.06720.13
7.0.70.0430.07020.05
7.0.60.0370.07020.16
7.0.50.0370.08320.55
7.0.40.0070.08320.06
7.0.30.0170.07720.02
7.0.20.0130.08020.05
7.0.10.0100.08020.09
7.0.00.0100.08320.13
5.6.280.0030.07321.04
5.6.250.0100.07020.94
5.6.240.0130.07020.75
5.6.230.0130.07320.75
5.6.220.0170.07020.74
5.6.210.0130.07720.77
5.6.200.0030.09721.13
5.6.190.0030.09021.18
5.6.180.0070.09021.13
5.6.170.0100.07021.07
5.6.160.0100.08021.18
5.6.150.0100.06721.17
5.6.140.0170.08021.14
5.6.130.0100.07721.29
5.6.120.0100.07721.29
5.6.110.0100.08021.04
5.6.100.0000.08721.16
5.6.90.0000.08721.02
5.6.80.0070.08020.68
5.6.70.0100.07020.55
5.6.60.0000.06320.62
5.6.50.0130.06720.55
5.6.40.0100.08320.41
5.6.30.0070.07320.52
5.6.20.0130.07020.58
5.6.10.0100.07720.59
5.6.00.0070.07720.48
5.5.380.0130.07320.61
5.5.370.0030.08020.54
5.5.360.0100.08320.46
5.5.350.0030.08720.49
5.5.340.0100.09020.87
5.5.330.0070.05020.91
5.5.320.0030.08021.04
5.5.310.0100.07721.04
5.5.300.0130.07720.85
5.5.290.0200.07021.00
5.5.280.0070.06720.89
5.5.270.0100.07720.88
5.5.260.0070.08020.99
5.5.250.0100.08020.84
5.5.240.0100.07720.39
5.5.230.0170.07020.26
5.5.220.0100.07320.22
5.5.210.0070.08020.33
5.5.200.0000.09020.27
5.5.190.0070.08320.35
5.5.180.0070.04720.23
5.5.160.0070.04320.28
5.5.150.0030.05020.34
5.5.140.0000.07720.11
5.5.130.0030.08020.28
5.5.120.0200.05320.37
5.5.110.0200.07020.36
5.5.100.0000.04320.20
5.5.90.0070.03720.21
5.5.80.0030.06720.16
5.5.70.0030.04020.11
5.5.60.0000.04320.27
5.5.50.0030.04020.20
5.5.40.0070.03320.27
5.5.30.0070.04320.07
5.5.20.0070.03720.16
5.5.10.0000.07720.16
5.5.00.0030.06720.18
5.4.450.0100.08019.47
5.4.440.0100.04319.50
5.4.430.0070.07719.27
5.4.420.0130.07019.47
5.4.410.0000.05019.30
5.4.400.0030.08018.91
5.4.390.0100.04319.10
5.4.380.0130.07019.17
5.4.370.0100.04319.14
5.4.360.0130.07318.91
5.4.350.0130.07019.11
5.4.340.0100.07718.96
5.4.320.0030.04719.14
5.4.310.0030.04318.91
5.4.300.0100.05719.23
5.4.290.0130.06719.13
5.4.280.0130.06319.08
5.4.270.0100.07319.09
5.4.260.0100.06719.17
5.4.250.0100.03018.95
5.4.240.0030.03718.95
5.4.230.0000.05319.16
5.4.220.0100.03319.10
5.4.210.0000.04019.08
5.4.200.0030.03719.08
5.4.190.0000.04319.13
5.4.180.0000.04319.16
5.4.170.0070.04019.09
5.4.160.0100.03719.15
5.4.150.0100.03319.15
5.4.140.0030.07016.55
5.4.130.0170.06716.36
5.4.120.0030.03716.52
5.4.110.0070.03316.43
5.4.100.0000.04716.55
5.4.90.0030.03316.44
5.4.80.0070.03316.54
5.4.70.0030.04016.42
5.4.60.0070.03316.54
5.4.50.0000.04016.52
5.4.40.0070.03316.52
5.4.30.0070.03016.54
5.4.20.0000.03716.45
5.4.10.0000.04716.42
5.4.00.0030.03715.95
5.3.290.0000.08714.77
5.3.280.0030.04714.77
5.3.270.0000.04014.73
5.3.260.0030.06014.75
5.3.250.0070.03314.68
5.3.240.0000.06714.79
5.3.230.0100.03314.77
5.3.220.0070.04014.68
5.3.210.0070.05314.64
5.3.200.0030.03714.64
5.3.190.0100.03314.70
5.3.180.0130.05014.61
5.3.170.0070.03314.77
5.3.160.0000.04314.70
5.3.150.0030.04714.70
5.3.140.0070.03014.64
5.3.130.0000.04014.63
5.3.120.0000.04014.78
5.3.110.0030.05014.60
5.3.100.0030.03314.26
5.3.90.0030.04014.09
5.3.80.0070.03714.28
5.3.70.0000.04014.19
5.3.60.0070.03014.04
5.3.50.0030.03714.13
5.3.40.0030.03314.05
5.3.30.0070.03013.95
5.3.20.0030.03313.95
5.3.10.0030.03313.89
5.3.00.0000.03713.68

preferences:
50.32 ms | 401 KiB | 5 Q