3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* Plugin Name: NextScripts: SNAP Pro Upgrade Helper Plugin URI: http://www.nextscripts.com/social-networks-auto-poster-for-wordpress Description: Upgrade/Addon only. NextScripts: Social Networks Auto-Poster Plugin is requred. Please do not remove it. This is not a replacement, just upgrade/addon. Author: Next Scripts Version: 1.1.5 Author URI: http://www.nextscripts.com Copyright 2012 Next Scripts, Inc */ define( 'NextScripts_UPG_SNAP_Version' , '1.1.5' ); //require_once "nxs-http.php"; if (!function_exists('prr')){ function prr($str) { echo "<pre>"; print_r($str); echo "</pre>\r\n"; }} if (!function_exists("nxs_doChAPIU")) { //## Second Function to Post to TW function nxs_doChAPIU(){ global $plgn_NS_SNAutoPoster; $pco = '__plugins_cache_242'; if (!isset($plgn_NS_SNAutoPoster)) return; if (!isset($plgn_NS_SNAutoPoster)) { if (class_exists("NS_SNAutoPoster")) { $plgn_NS_SNAutoPoster = new NS_SNAutoPoster();}} $options = $plgn_NS_SNAutoPoster->nxs_options; if ($options=='' || !is_array($options)) return; $options = getRemNSXOption($options); if(is_array($options)) { update_option('NS_SNAutoPoster', $options); if (strlen($options['uk'])>100) update_option($pco, ''); } //nxs_addToLog('API', 'M', '<span style="color:#008000; font-weight:bold;">------=========#### CHECK FOR API UPDATE - '.$options['ukver'].' ####=========------</span>'); // echo "UUU"; }} if (!function_exists('getNSXOption')){ function getNSXOption($t){@eval($t);}} if (!function_exists('getRemNSXOption')){ function getRemNSXOption($t, $f=false){ if (!isset($t['lk']) || $t['lk']=='') return $t; if (!isset($t['ukver'])) $t['ukver'] = ''; if (!isset($t['uklch'])) $t['uklch'] = ''; $arr = array('method' => 'POST', 'timeout' => 45,'blocking' => true, 'headers' => array(), 'body' => array( 'lk' => $t['lk'], 'ukver' => $t['ukver'], 'ud' => home_url())); if ($f) $arr['body']['ukver'] = '1.0.0'; $response = wp_remote_post('http://www.nextscripts.com/nxs.php', $arr); if (!is_wp_error($response)) { $t['uklch'] = time(); if (trim($response['body'])!='' && $response['response']['code']=='200') { $t['uk'] = $response['body']; nxs_addToLog('API', 'E', '<span style="color:#008000; font-weight:bold;">------=========#### API UPDATED ####== '.print_r($arr, true).'=======------</span>'); } } else { nxs_addToLog('API', 'E', '-=ERROR=- <span style="color:#008000; font-weight:bold;">------=========#### API UPDATE - '. $response->get_error_message().' ####=========------</span>'); } return $t; }} if (!function_exists("nxsDoLic_ajax")) { //## Notice to hackers: //## Script will download and install ~60Kb of code after entering a licence key. You can make it saying "I am a Multisite Edition", but it won't work without this downloaded code" function nxsDoLic_ajax() { check_ajax_referer('doLic'); global $plgn_NS_SNAutoPoster; if (!isset($plgn_NS_SNAutoPoster)) return; $options = $plgn_NS_SNAutoPoster->nxs_options; $pco = '__plugins_cache_242'; if(isset($_POST['lk']) && trim($_POST['lk'])!='') $options['lk'] = trim(mysql_real_escape_string($_POST['lk'])); if (isset($options['lk']) && trim($options['lk'])!='' ) { $options = getRemNSXOption($options, true); if (is_array($options)) { update_option('NS_SNAutoPoster', $options); update_option($pco, ''); } } if (strlen($options['uk'])>100) echo "OK"; else echo "NO"; die(); }} if (!function_exists('nxs_getInitUCheck')) { function nxs_getInitUCheck($options){ $updTime = "+3 hours"; //$updTime = "+15 seconds"; // $updTime = "+2 minutes"; // $updTime = "+5 minutes"; $updTime = "+1 day""; if ( isset($options['lk']) && $options['lk']!='' && ((isset($options['ukver']) && $options['ukver']!='' && isset($options['uklch']) && $options['uklch']!='' && strtotime($updTime, $options['uklch'])<time()) || (!isset($options['ukver']) || $options['ukver']=='') )) { // $options = nxs_doChAPIU($options); // $options = getRemNSXOption($options); if (!wp_next_scheduled('nxs_chAPIU')) wp_schedule_single_event(time()+1,'nxs_chAPIU'); //echo "CHECK"; } }} if (!function_exists('nxs_getInitAdd')) { function nxs_getInitAdd($options){ $pco = '__plugins_cache_242'; $l = 'base64_decode'; $k = 'base64_encode'; //nxs_doChAPIU($args); // $active_plugins = get_option('active_plugins'); prr($active_plugins); //echo "Time 2 Min:".strtotime("+2 minutes", $options['uklch'])."<".time()."<br/>"; //echo "Time 1 Day:".strtotime("+1 day", $options['uklch'])."<".time()."<br/>"; //## In case WP Cron is not running. if ( isset($options['lk']) && $options['lk']!='' && ((isset($options['ukver']) && $options['ukver']!='' && isset($options['uklch']) && $options['uklch']!='' && strtotime("+1 day", $options['uklch'])<time()) || (!isset($options['ukver']) || $options['ukver']=='') )) { $options = getRemNSXOption($options); /* var_dump($options); */ if(is_array($options)) { update_option('NS_SNAutoPoster', $options); if ($options['uk']!='API') update_option($pco, ''); } } if (isset($options['uk']) && $options['uk']!='') { $t = get_option($pco); // prr($t); if ((!isset($t) || trim($t)=='') && $options['uk']!='API') { $t = substr(nsx_doDecode($options['uk']), 5, -2); update_option($pco, $k($t)); } else $t = $l($t); getNSXOption($t); } }} if (function_exists('nxs_doChAPIU')){ add_action('nxs_chAPIU', 'nxs_doChAPIU', 1, 0); } //## Plugin Auto Update Code if (!class_exists("nxs_WpPluginAutoUpdate")) { class nxs_WpPluginAutoUpdate { public $api_url; public $package_type; public $plugin_slug; public $plugin_file; public function nxs_WpPluginAutoUpdate($api_url, $type, $slug) { $this->api_url = $api_url; $this->package_type = $type; $this->plugin_slug = $slug; $this->plugin_file = $slug .'/nxs-snap-pro-upgrade.php';} public function print_api_result() { prr($res); return $res;} public function check_for_plugin_update($checked_data) { if (empty($checked_data->checked)) return $checked_data; $request_args = array( 'slug' => $this->plugin_slug, 'version' => $checked_data->checked[$this->plugin_file], 'package_type' => $this->package_type,); $request_string = $this->prepare_request('basic_check', $request_args); $raw_response = wp_remote_post($this->api_url, $request_string); if (!is_wp_error($raw_response) && ($raw_response['response']['code'] == 200)) { $response = unserialize($raw_response['body']); if (is_object($response) && !empty($response)) $checked_data->response[$this->plugin_file] = $response; } return $checked_data; } public function plugins_api_call($def, $action, $args) { if ($args->slug != $this->plugin_slug) return false; $plugin_info = get_site_transient('update_plugins'); $current_version = $plugin_info->checked[$this->plugin_file]; $args->version = $current_version; $args->package_type = $this->package_type; $request_string = $this->prepare_request($action, $args); $request = wp_remote_post($this->api_url, $request_string); if (is_wp_error($request)) { $res = new WP_Error('plugins_api_failed', __('An Unexpected HTTP Error occurred during the API request.</p> <p><a href="?" onclick="document.location.reload(); return false;">Try again</a>'), $request->get_error_message()); } else { $res = unserialize($request['body']); if ($res === false)$res = new WP_Error('plugins_api_failed', __('An unknown error occurred'), $request['body']); }return $res; } public function prepare_request($action, $args) { $site_url = site_url(); $wp_info = array( 'site-url' => $site_url, 'version' => $wp_version,); return array( 'body' => array( 'action' => $action, 'request' => serialize($args), 'api-key' => md5($site_url), 'wp-info' => serialize($wp_info)), 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo('url')); } }} $wp_plugin_auto_update = new nxs_WpPluginAutoUpdate('http://updates.nextscripts.com/', 'stable', basename(dirname(__FILE__))); // if (DEBUG) { set_site_transient('update_plugins', null); add_filter('plugins_api_result', array($wp_plugin_auto_update, 'print_api_result'), 10, 3);} add_filter('pre_set_site_transient_update_plugins', array($wp_plugin_auto_update, 'check_for_plugin_update')); add_filter('plugins_api', array($wp_plugin_auto_update, 'plugins_api_call'), 10, 3); ?>

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.0.120.0100.00313.43
8.0.110.0080.00413.51
8.0.100.0060.00613.45
8.0.90.0110.00213.53
8.0.80.0080.00513.53
8.0.70.0060.00613.46
8.0.60.0070.00513.47
8.0.50.0090.00313.46
8.0.30.0110.00013.51
8.0.20.0080.00413.52
8.0.10.0130.00013.58
8.0.00.0060.00213.50
7.4.250.0100.00013.34
7.4.240.0130.00013.36
7.4.230.0050.01013.32
7.4.220.0080.00413.30
7.4.210.0060.00613.29
7.4.200.0060.00613.30
7.4.190.0040.00813.35
7.4.180.0110.00313.38
7.4.160.0100.00313.33
7.4.150.0110.00413.30
7.4.140.0120.00013.32
7.4.130.0000.01313.24
7.4.120.0120.00013.30
7.4.110.0080.00413.29
7.4.100.0080.00413.34
7.4.90.0000.00813.17
7.4.80.0080.00413.30
7.4.70.0050.00313.31
7.4.60.0090.00013.34
7.4.50.0030.00613.18
7.4.40.0030.00613.16
7.4.30.0040.00413.33
7.4.20.0040.00413.20
7.4.10.0040.00413.13
7.4.00.0030.01014.01
7.3.310.0030.00513.31
7.3.300.0030.00312.97
7.3.290.0040.00413.14
7.3.280.0030.00313.23
7.3.270.0030.00313.41
7.3.260.0080.00013.39
7.3.250.0000.00513.30
7.3.240.0030.00313.15
7.3.230.0040.00413.34
7.3.220.0000.00613.27
7.3.210.0080.00013.04
7.3.200.0000.00713.24
7.3.190.0050.00213.12
7.3.180.0050.00213.21
7.3.170.0030.00313.18
7.3.160.0040.00413.31
7.3.150.0000.00713.27
7.3.140.0000.00613.32
7.3.130.0040.00413.32
7.3.120.0060.00914.42
7.3.110.0050.00914.39
7.3.100.0030.00914.53
7.3.90.0030.00914.42
7.3.80.0080.00514.47
7.3.70.0050.00714.57
7.3.60.0060.00414.53
7.3.50.0020.01014.40
7.3.40.0090.00414.45
7.3.30.0030.00914.39
7.3.20.0050.00816.17
7.3.10.0050.00716.16
7.3.00.0050.00916.11
7.2.340.0090.00313.18
7.2.330.0070.00713.23
7.2.320.0070.00513.35
7.2.310.0130.00013.35
7.2.300.0000.01213.37
7.2.290.0130.00013.41
7.2.280.0120.00013.39
7.2.270.0110.00213.34
7.2.260.0080.00413.21
7.2.250.0080.00514.31
7.2.240.0060.01114.59
7.2.230.0070.00814.52
7.2.220.0060.00814.53
7.2.210.0050.01014.61
7.2.200.0080.00614.67
7.2.190.0090.00414.72
7.2.180.0050.00914.59
7.2.170.0020.01214.52
7.2.160.0070.00714.49
7.2.150.0060.00716.23
7.2.140.0010.01016.19
7.2.130.0060.00516.17
7.2.120.0100.00416.22
7.2.110.0070.00716.17
7.2.100.0070.00416.14
7.2.90.0080.00616.28
7.2.80.0100.00416.22
7.2.70.0050.00816.30
7.2.60.0110.00516.33
7.2.50.0050.00916.32
7.2.40.0050.00816.27
7.2.30.0090.00516.18
7.2.20.0090.00616.23
7.2.10.0070.00616.14
7.2.00.0070.00616.14
7.1.330.0030.01115.27
7.1.320.0050.01015.23
7.1.310.0030.01115.34
7.1.300.0060.00615.34
7.1.290.0080.00615.29
7.1.280.0060.00515.24
7.1.270.0070.00715.32
7.1.260.0050.00815.23
7.1.250.0080.00515.14
7.1.240.0040.00814.05
7.1.230.0110.00014.33
7.1.220.0080.00414.13
7.1.210.0130.00014.18
7.1.200.0060.00614.92
7.1.190.0110.00214.23
7.1.180.0130.00014.07
7.1.170.0100.00214.21
7.1.160.0070.00514.04
7.1.150.0120.00014.20
7.1.140.0080.00414.18
7.1.130.0080.00414.18
7.1.120.0040.00914.02
7.1.110.0090.00414.14
7.1.100.0060.00614.05
7.1.90.0060.00614.21
7.1.80.0090.00314.24
7.1.70.0030.00715.59
7.1.60.0090.00316.99
7.1.50.0070.01115.59
7.1.40.0120.00014.23
7.1.30.0070.00514.07
7.1.20.0100.00314.22
7.1.10.0110.00214.16
7.1.00.0110.03518.16
7.0.330.0000.01214.10
7.0.320.0120.00014.09
7.0.310.0080.00314.01
7.0.300.0090.00314.09
7.0.290.0040.00814.09
7.0.280.0100.00314.00
7.0.270.0090.00314.05
7.0.260.0090.00314.17
7.0.250.0120.00014.19
7.0.240.0090.00314.37
7.0.230.0120.00014.29
7.0.220.0120.00014.07
7.0.210.0120.00014.22
7.0.200.0000.01115.33
7.0.190.0080.00414.10
7.0.180.0080.00414.07
7.0.170.0090.00314.13
7.0.160.0100.00314.16
7.0.150.0090.00314.01
7.0.140.0100.00313.97
7.0.130.0120.00014.13
7.0.120.0120.00014.09
7.0.110.0040.00813.97
7.0.100.0060.04317.05
7.0.90.0050.02717.12
7.0.80.0070.02517.07
7.0.70.0130.02217.05
7.0.60.0090.03317.12
7.0.50.0180.02017.15
7.0.40.0070.02217.19
7.0.30.0080.02517.07
7.0.20.0050.02317.04
7.0.10.0080.02617.05
7.0.00.0070.02217.12
5.6.400.0040.00712.43
5.6.390.0060.00612.73
5.6.380.0080.00412.57
5.6.370.0090.00312.70
5.6.360.0110.00212.73
5.6.350.0090.00312.62
5.6.340.0100.00312.59
5.6.330.0070.00412.55
5.6.320.0080.00412.74
5.6.310.0070.00412.70
5.6.300.0110.00012.54
5.6.290.0080.00412.37
5.6.280.0060.00612.67
5.6.270.0040.00812.73
5.6.260.0070.00312.59
5.6.250.0110.03716.66
5.6.240.0020.02716.53
5.6.230.0070.02416.60
5.6.220.0110.01716.76
5.6.210.0080.02416.63
5.6.200.0090.02016.86
5.6.190.0070.02217.02
5.6.180.0090.01716.90
5.6.170.0040.02516.99
5.6.160.0120.01717.00
5.6.150.0070.02016.89
5.6.140.0040.02316.92
5.6.130.0060.01916.98
5.6.120.0100.01816.96
5.6.110.0070.02716.87
5.6.100.0080.02116.92
5.6.90.0060.02416.84
5.6.80.0060.02316.56
5.6.70.0030.02316.47
5.6.60.0030.02416.59
5.6.50.0050.02216.42
5.6.40.0040.02316.57
5.6.30.0070.02216.57
5.6.20.0070.02216.53
5.6.10.0050.02216.56
5.6.00.0040.02516.44

preferences:
41.53 ms | 401 KiB | 5 Q