3v4l.org

run code in 500+ PHP versions simultaneously
<?php /** * Identities IMAP * * This plugin allows fast switching between accounts. * * @version 1.0 * @author Boris Gulay * @url */ class ident_switch extends rcube_plugin { public $task='?(?!login|logout).*'; const TABLE = 'ident_switch'; const MY_POSTFIX = '_iswitch'; // Flags user in database const DB_ENABLED = 1; //const DB_SECURE_SSL = 2; // Not supported any more const DB_SECURE_IMAP_TLS = 4; private static function arr($array, $key, $default = null) { return $array[$key] ?? $default; } function init() { $this->add_hook('startup', array($this, 'on_startup')); $this->add_hook('render_page', array($this, 'on_render_page')); $this->add_hook('smtp_connect', array($this, 'on_smtp_connect')); $this->add_hook('identity_form', array($this, 'on_identity_form')); $this->add_hook('identity_update', array($this, 'on_identity_update')); $this->add_hook('identity_create', array($this, 'on_identity_create')); $this->add_hook('identity_create_after', array($this, 'on_identity_create_after')); $this->add_hook('identity_delete', array($this, 'on_identity_delete')); $this->add_hook('template_object_composeheaders', array($this, 'on_template_object_composeheaders')); $this->register_action('plugin.ident_switch.switch', array($this, 'on_switch')); } function on_startup($args) { $rc = rcmail::get_instance(); if (strcasecmp($rc->user->data['username'], $_SESSION['username']) !== 0) { // We are impersonating $rc->config->set('imap_cache', null); $rc->config->set('messages_cache', false); if ($args['task'] == 'mail') { $this->add_texts('localization/'); $rc->config->set('create_default_folders', false); } } return $args; } function on_render_page($args) { $rc = rcmail::get_instance(); switch ($rc->task) { case 'mail': $this->render_switch($rc, $args); break; case 'settings': $this->include_script('ident_switch-form.js'); break; } return $args; }<?php /** * Identities IMAP * * This plugin allows fast switching between accounts. * * @version 1.0 * @author Boris Gulay * @url */ class ident_switch extends rcube_plugin { public $task='?(?!login|logout).*'; const TABLE = 'ident_switch'; const MY_POSTFIX = '_iswitch'; // Flags user in database const DB_ENABLED = 1; //const DB_SECURE_SSL = 2; // Not supported any more const DB_SECURE_IMAP_TLS = 4; private static function arr($array, $key, $default = null) { return $array[$key] ?? $default; } function init() { $this->add_hook('startup', array($this, 'on_startup')); $this->add_hook('render_page', array($this, 'on_render_page')); $this->add_hook('smtp_connect', array($this, 'on_smtp_connect')); $this->add_hook('identity_form', array($this, 'on_identity_form')); $this->add_hook('identity_update', array($this, 'on_identity_update')); $this->add_hook('identity_create', array($this, 'on_identity_create')); $this->add_hook('identity_create_after', array($this, 'on_identity_create_after')); $this->add_hook('identity_delete', array($this, 'on_identity_delete')); $this->add_hook('template_object_composeheaders', array($this, 'on_template_object_composeheaders')); $this->register_action('plugin.ident_switch.switch', array($this, 'on_switch')); } function on_startup($args) { $rc = rcmail::get_instance(); if (strcasecmp($rc->user->data['username'], $_SESSION['username']) !== 0) { // We are impersonating $rc->config->set('imap_cache', null); $rc->config->set('messages_cache', false); if ($args['task'] == 'mail') { $this->add_texts('localization/'); $rc->config->set('create_default_folders', false); } } return $args; } function on_render_page($args) { $rc = rcmail::get_instance(); switch ($rc->task) { case 'mail': $this->render_switch($rc, $args); break; case 'settings': $this->include_script('ident_switch-form.js'); break; } return $args; }

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.5.30.0090.00916.90
8.5.20.0090.00816.90
8.5.10.0070.01016.90
8.5.00.0090.00816.90
8.4.180.0140.00919.72
8.4.170.0150.00719.82
8.4.160.0170.00819.78
8.4.150.0120.01119.42
8.4.140.0120.00817.73
8.4.130.0100.01017.91
8.4.120.0120.00917.89
8.4.110.0120.00717.92
8.4.100.0080.00817.96
8.4.90.0120.00717.96
8.4.80.0110.00717.88
8.4.70.0100.00817.86
8.4.60.0080.00917.86
8.4.50.0120.00917.91
8.4.40.0150.00617.75
8.4.30.0140.00917.66
8.4.20.0120.00717.84
8.4.10.0120.01117.77
8.3.300.0160.00418.32
8.3.290.0090.00718.38
8.3.280.0070.00918.41
8.3.270.0060.00216.90
8.3.260.0060.00416.90
8.3.250.0060.00316.90
8.3.240.0160.00416.90
8.3.230.0080.00516.90
8.3.220.0050.00416.90
8.3.210.0040.00516.98
8.3.200.0110.00816.90
8.3.190.0060.00216.90
8.3.180.0110.00616.96
8.3.170.0090.00616.90
8.3.160.0090.00616.93
8.3.150.0070.00616.90
8.3.140.0070.00116.90
8.3.130.0050.00316.90
8.3.120.0040.00416.90
8.3.110.0030.00516.90
8.3.100.0140.00516.90
8.3.90.0110.00516.90
8.3.80.0100.00816.90
8.3.70.0090.01116.90
8.3.60.0140.00516.90
8.3.50.0110.00816.90
8.3.40.0130.00718.10
8.3.30.0130.00718.04
8.3.20.0120.00918.02
8.3.10.0140.00618.03
8.3.00.0100.00818.02

preferences:
50.23 ms | 705 KiB | 4 Q