3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php /* Plugin Name: Weather Plugin Plugin URI: http://www.yourpluginurlhere.com/ Version: Current Version Author: Name please Description: What does your plugin do and what features does it offer... */ /** * Weather Plugin For Wordpress */ /** * Proper way to enqueue scripts and styles */ define('APFSURL', WP_PLUGIN_URL . "/" . dirname(plugin_basename(__FILE__))); function theme_name_scripts() { //define('weather-plugin', WP_PLUGIN_URL . "/" . dirname(plugin_basename(__FILE__))); wp_enqueue_style( 'weather-plugin', get_stylesheet_uri() ); wp_enqueue_script( 'weather-plugin',APFSURL.'/js/weather-plugin.js', array(), '1.0.0', true ); } add_action( 'wp_enqueue_scripts', 'theme_name_scripts' ); add_shortcode('weather-plugin','weather_function'); function weather_function(){ $ip = '203.135.41.33';//$_SERVER['REMOTE_ADDR']; $xml = new SimpleXMLElement(file_get_contents("http://www.geoplugin.net/xml.gp?={$ip}")); $city = (array)$xml->geoplugin_city; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%20in%20(select%20woeid%20from%20geo.places(1)%20where%20text%3D%22%27'.$city[0].'%27%2C%20ak%22)&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $weather_rss = curl_exec($ch); echo curl_error($ch); curl_close($ch); $return = json_decode($weather_rss); var_dump($weather_rss); $temp = $return->query->results->channel->item->condition->temp; echo "<div> Weather &nbsp; : &nbsp;"; echo "<div class = 'farenheit'> ".$temp." </div>"; $centi = 5/9*($temp-32); $centi1 = number_format((float)$centi, 0, '.', ''); echo "<div class = 'centigrade' style='display:none'> ".$centi1." </div>"; echo "<a hredf='#' id='btn1'>&nbsp;F</a> / <a href='#' id='btn2'> C</a>"; echo "</div>"; } ?>
based on CGouK

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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.3.00.0040.00716.22
7.2.130.0110.00316.81
7.2.120.0080.00616.50
7.2.110.0130.00316.84
7.2.100.0060.00916.84
7.2.90.0160.00016.84
7.2.80.0130.00316.58
7.2.70.0050.00816.60
7.2.60.0060.00916.71
7.2.50.0030.01016.70
7.2.40.0040.00716.88
7.2.30.0120.00316.85
7.2.20.0030.01216.77
7.2.10.0090.00316.78
7.2.00.0080.00618.05
7.1.250.0060.00615.48
7.1.240.0090.00915.55
7.1.230.0030.01015.76
7.1.220.0070.01015.63
7.1.210.0060.00615.60
7.1.200.0160.00615.64
7.1.190.0040.00715.59
7.1.180.0110.00015.67
7.1.170.0060.00615.79
7.1.160.0100.00315.61
7.1.150.0060.00615.67
7.1.140.0060.00615.48
7.1.130.0060.00615.53
7.1.120.0060.00315.60
7.1.110.0050.00315.73
7.1.100.0020.01116.76
7.1.90.0090.00315.77
7.1.80.0060.00915.61
7.1.70.0040.00816.16
7.1.60.0090.01117.50
7.1.50.0050.01116.15
7.1.40.0060.00615.45
7.1.30.0030.00615.57
7.1.20.0070.00715.63
7.1.10.0080.00815.64
7.1.00.0050.04119.09
7.0.330.0000.00915.35
7.0.320.0060.00315.13
7.0.310.0140.00015.40
7.0.300.0130.00015.25
7.0.290.0030.00615.30
7.0.280.0000.00915.36
7.0.270.0040.00415.23
7.0.260.0000.01215.46
7.0.250.0110.00015.10
7.0.240.0000.00715.31
7.0.230.0120.00315.46
7.0.220.0000.00715.37
7.0.210.0110.00415.46
7.0.200.0050.00515.92
7.0.190.0030.01015.39
7.0.180.0090.00315.46
7.0.170.0090.00315.40
7.0.160.0070.00315.52
7.0.150.0120.00315.27
7.0.140.0070.00815.20
7.0.130.0080.00515.46
7.0.120.0060.00615.39
7.0.110.0030.00615.46
7.0.100.0110.00015.45
7.0.90.0060.00615.41
7.0.80.0030.01015.37
7.0.70.0030.01015.18
7.0.60.0080.02817.59
7.0.50.0060.02616.63
7.0.40.0100.04716.80
7.0.30.0200.03616.78
7.0.20.0150.03616.71
7.0.10.0080.02316.82
7.0.00.0030.04116.69
5.6.380.0060.00714.33
5.6.370.0030.00514.20
5.6.360.0030.01014.20
5.6.350.0060.00314.07
5.6.340.0060.00614.04
5.6.330.0060.00614.24
5.6.320.0080.00413.97
5.6.310.0040.01114.50
5.6.300.0090.00714.25
5.6.290.0090.00914.39
5.6.280.0020.02117.45
5.6.270.0090.00914.36
5.6.260.0090.00614.07
5.6.250.0090.00313.72
5.6.240.0120.00214.17
5.6.230.0060.01014.20
5.6.220.0030.00813.84
5.6.210.0100.02817.45
5.6.200.0090.04216.18
5.6.190.0110.03417.24
5.6.180.0150.02817.28
5.6.170.0170.04317.23
5.6.160.0120.03817.12
5.6.150.0070.02816.23
5.6.140.0050.04116.24
5.6.130.0110.03916.15
5.6.120.0030.03417.49
5.6.110.0070.03017.58
5.6.100.0020.02517.70
5.6.90.0060.04317.54
5.6.80.0060.02117.21
5.6.70.0060.00614.14
5.6.60.0000.01114.05
5.6.50.0030.01014.21
5.6.40.0070.00714.12
5.6.30.0000.01214.02
5.6.20.0040.01113.97
5.6.10.0060.00614.19
5.6.00.0070.00714.00
5.5.380.0030.00610.95
5.5.370.0070.00411.11
5.5.360.0060.00311.28
5.5.350.0000.04515.66
5.5.340.0030.04814.44
5.5.330.0030.02715.75
5.5.320.0070.02715.60
5.5.310.0190.04215.69
5.5.300.0060.02014.47
5.5.290.0070.02214.58
5.5.280.0080.04415.91
5.5.270.0100.04316.04
5.5.260.0020.03616.10
5.5.250.0060.03515.91
5.5.240.0110.03315.61
5.5.230.0030.00311.00
5.5.220.0090.00311.04
5.5.210.0000.00910.90
5.5.200.0030.00611.13
5.5.190.0060.00310.90
5.5.180.0030.00611.00
5.5.170.0060.00310.98
5.5.160.0030.00310.90
5.5.150.0060.00311.11
5.5.140.0000.00910.90
5.5.130.0040.00410.96
5.5.120.0000.00911.19
5.5.110.0070.00610.90
5.5.100.0040.00710.99
5.5.90.0080.00311.00
5.5.80.0060.00610.90
5.5.70.0080.00310.95
5.5.60.0080.00310.97
5.5.50.0120.00011.02
5.5.40.0030.00311.00
5.5.30.0000.01111.06
5.5.20.0030.00910.90
5.5.10.0040.00411.02
5.5.00.0090.00610.90
5.4.450.0340.03015.26
5.4.440.0320.03015.10
5.4.430.0260.03215.42
5.4.420.0280.03315.26
5.4.410.0290.02815.32
5.4.400.0290.02515.22
5.4.390.0240.03414.94
5.4.380.0300.03115.01
5.4.370.0270.02815.09
5.4.360.0230.03114.88
5.4.350.0300.02315.20
5.4.340.0280.03314.88
5.4.330.0050.00310.90
5.4.320.0320.04615.22
5.4.310.0300.02814.98
5.4.300.0230.02815.18
5.4.290.0130.03315.03
5.4.280.0320.03114.93
5.4.270.0250.03515.13
5.4.260.0270.03215.19
5.4.250.0300.03415.20
5.4.240.0390.03015.09
5.4.230.0360.02815.04
5.4.220.0380.02715.10
5.4.210.0370.03115.23
5.4.200.0310.02814.94
5.4.190.0350.02815.02
5.4.180.0330.02515.05
5.4.170.0240.02915.01
5.4.160.0390.02815.01
5.4.150.0320.03515.01
5.4.140.0310.03913.66
5.4.130.0280.02713.76
5.4.120.0390.03213.67
5.4.110.0340.03413.57
5.4.100.0350.02813.78
5.4.90.0330.03013.73
5.4.80.0380.02513.68
5.4.70.0050.03813.61
5.4.60.0090.02013.61
5.4.50.0050.03813.69
5.4.40.0200.02213.66
5.4.30.0230.02813.58
5.4.20.0110.02813.72
5.4.10.0000.00710.90
5.4.00.0030.00910.90
5.3.290.3970.03714.66
5.3.280.3500.04014.75
5.3.270.4070.04014.70
5.3.260.3200.03014.54
5.3.250.0270.07714.53
5.3.240.0230.06714.61
5.3.230.2800.03714.77
5.3.220.4170.03314.59
5.3.210.0270.03714.63
5.3.200.0300.04714.57
5.3.190.0230.06314.48
5.3.180.0100.03714.56