3v4l.org

run code in 300+ PHP versions simultaneously
<?php //Theme Name $themename = "Dance Floor"; //prefix $shortname = "theme_"; //Array $options = array ( array( "name" => "Videos urls", "id" => $shortname."_videosArray", "std" => "a:5:{s:10:\"url_video1\";a:3:{s:4:\"link\";s:1:\"#\";s:6:\"height\";i:250;s:5:\"width\";i:300;}s:10:\"url_video1\";a:3:{s:4:\"link\";s:1:\"#\";s:6:\"height\";i:250;s:5:\"width\";i:300;}s:10:\"url_video1\";a:3:{s:4:\"link\";s:1:\"#\";s:6:\"height\";i:250;s:5:\"width\";i:300;}s:10:\"url_video1\";a:3:{s:4:\"link\";s:1:\"#\";s:6:\"height\";i:250;s:5:\"width\";i:300;}s:10:\"url_video1\";a:3:{s:4:\"link\";s:1:\"#\";s:6:\"height\";i:250;s:5:\"width\";i:300;}}"), array( "name" => "Banners", "id" => $shortname."_bannersArray", "std" => "a:6:{s:13:\"theme_banner1\";a:5:{s:4:\"link\";s:1:\"#\";s:9:\"image_url\";s:0:\"\";s:6:\"height\";i:125;s:5:\"width\";i:125;s:6:\"status\";i:0;}s:13:\"theme_banner2\";a:5:{s:4:\"link\";s:1:\"#\";s:9:\"image_url\";s:0:\"\";s:6:\"height\";i:125;s:5:\"width\";i:125;s:6:\"status\";i:0;}s:13:\"theme_banner3\";a:5:{s:4:\"link\";s:1:\"#\";s:9:\"image_url\";s:0:\"\";s:6:\"height\";i:125;s:5:\"width\";i:125;s:6:\"status\";i:0;}s:13:\"theme_banner4\";a:5:{s:4:\"link\";s:1:\"#\";s:9:\"image_url\";s:0:\"\";s:6:\"height\";i:125;s:5:\"width\";i:125;s:6:\"status\";i:0;}s:13:\"theme_banner5\";a:6:{s:4:\"link\";s:1:\"#\";s:9:\"image_url\";s:0:\"\";s:6:\"height\";i:250;s:5:\"width\";i:300;s:6:\"status\";i:0;s:7:\"adsense\";s:0:\"\";}s:13:\"theme_banner6\";a:6:{s:4:\"link\";s:1:\"#\";s:9:\"image_url\";s:0:\"\";s:6:\"height\";i:60;s:5:\"width\";i:468;s:6:\"status\";i:0;s:7:\"adsense\";s:0:\"\";}}" ), array( "name" => "Styles", "id" => $shortname."_css", "std" => "style.css" ), array( "name" => "flickr", "id" => $shortname."_flickr", "std" => "a:4:{s:4:\"nsid\";s:0:\"\";s:7:\"display\";s:0:\"\";s:11:\"displayType\";s:0:\"\";s:4:\"tags\";s:0:\"\";}" ), array( "name" => "musicplayer", "id" => $shortname."_musicplayer", "std" => "a:2:{s:2:\"id\";s:0:\"\";s:3:\"num\";s:1:\"5\";}" ), array( "name" => "FeedbSumition", "id" => $shortname."_musicplayerSumition", "std" => "" ), array( "name" => "html5", "id" => $shortname."_html5", "std" => "" ), array( "name" => "BannersStatus", "id" => $shortname."_bannerStatus", "std" => "1" ), ); //Flickr display types $flickrDisplayType = Array("square", "thumbnail", "small"); //Existing CSS Files $cssFiles = get_availableCss(); function get_bannersSettings($bannerId, $index = FALSE){ global $themename, $shortname, $options; $theBanners = get_option($shortname."_bannersArray"); if(!is_array($theBanners)){ $theBanners = unserialize($options[1]["std"]); } $theActualBanner = $theBanners[$bannerId]; if($index != FALSE){ return $theActualBanner[$index]; }else{ return $theActualBanner; } } function get_videoSettings($videoId, $index){ global $themename, $shortname, $options; $theVideos = get_option($shortname."_videosArray"); if(!is_array($theVideos)){ $theVideos = unserialize($options[0]["std"]); } $theActualVideo = $theVideos[$videoId]; return $theActualVideo[$index]; } function get_flickrSettings($index){ global $themename, $shortname, $options; $theflickrSettings = get_option($shortname."_flickr"); if(!is_array($theflickrSettings)){ $theflickrSettings = unserialize($options[3]["std"]); } return $theflickrSettings[$index]; } function get_musicplayer($index){ global $themename, $shortname, $options; $themusicplayerSettings = get_option($shortname."_musicplayer"); if(!is_array($themusicplayerSettings)){ $themusicplayerSettings = unserialize($options[4]["std"]); } return $themusicplayerSettings[$index]; } /* Get Available CSS */ function get_availableCss(){ $result = array(); $dir = dir(TEMPLATEPATH."/"); while (false !== ($file = $dir->read())) { if(ereg("\.css", $file, $r)){ $result[] = $file; } } $dir->close(); return $result; } /* Reset or Update Theme Options */ function newThemeOptions_add_admin() { global $themename, $shortname, $options, $cssFiles; if ( $_GET['page'] == basename(""__FILE__ not allowed" not allowed" not allowed" not allowed" not allowed") ) { if($_REQUEST['saveButton']){ while(list($videoId, $bannerInfo) = each($_REQUEST[$shortname."_video"])){ $videoInfo["width"] = get_videoSettings($videoId, "width"); $videoInfo["height"] = get_videoSettings($videoId, "height"); $videoInfo["link"] = $_REQUEST[$shortname."_video"][$videoId]["link"]; $allVideos[$videoId] = $bannerInfo; } update_option( $shortname."_videosArray", $allVideos); update_option( $shortname."_css", $_REQUEST[ $shortname."_css" ] ); while(list($bannerId, $bannerInfo) = each($_REQUEST[$shortname."_banner"])){ $bannerInfo["width"] = get_bannersSettings($bannerId, "width"); $bannerInfo["height"] = get_bannersSettings($bannerId, "height"); $bannerInfo["status"] = $_REQUEST[$shortname."_banner"][$bannerId]["status"]; if($_REQUEST[$shortname."_banner"][$bannerId]["adsense"]) $bannerInfo["adsense"] = ($_REQUEST[$shortname."_banner"][$bannerId]["adsense"]); $allBanners[$bannerId] = $bannerInfo; } update_option( $shortname."_bannersArray", $allBanners); update_option( $shortname."_flickr", $_REQUEST[$shortname."_flickr"]); update_option( $shortname."_musicplayer", $_REQUEST[$shortname."_musicplayer"]); update_option( $shortname."_musicplayerSumition", $_REQUEST[$shortname."_musicplayerSumition"]); update_option( $shortname."_html5", $_REQUEST[$shortname."_html5"]); update_option( $shortname."_bannerStatus", $_REQUEST[$shortname."_bannerStatus"]); header("Location: themes.php?page=functions.php&saved=true"); die; }else if($_REQUEST['resetButton']){ foreach ($options as $value) { delete_option( $value['id'] ); } header("Location: themes.php?page=functions.php&reset=true"); die; } } add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename("""""__FILE__ not allowed" not allowed" not allowed" not allowed" not allowed"), 'newThemeOptions_admin'); } function newThemeOptions_admin() { global $themename, $shortname, $options, $cssFiles, $flickrDisplayType; if ( $_REQUEST['saved'] ) echo '<div id="message" class="updated fade"><p><strong>'.$themename.' settings saved.</strong></p></div>'; if ( $_REQUEST['reset'] ) echo '<div id="message" class="updated fade"><p><strong>'.$themename.' settings reset.</strong></p></div>'; echo "\n<style type='text/css'>"; echo "\ndiv.wrap dl{margin: 0; padding: 0;}"; echo "\ndiv.wrap dt{position: relative; left: 0; top: 1.1em; width: 8em; font-weight: bold;}"; echo "\ndiv.wrap dd{ margin: 0 0 0 10em; padding: 0 0 .5em .5em;}"; echo "\table#outer dl h3, table#outer td.right dl h4 { font-size: 10pt; font-weight: bold; margin:0; padding: 4px 10px 4px 10px; }"; echo "\n</style>"; echo "\n<script>"; echo "\n\tfunction markAll(selectStatus){"; echo "\n\t\tif(selectStatus){"; echo "\n\t\t\tdocument.getElementById('theme__banner[theme_banner1][status]').checked = true;"; echo "\n\t\t\tdocument.getElementById('theme__banner[theme_banner2][status]').checked = true;"; echo "\n\t\t\tdocument.getElementById('theme__banner[theme_banner3][status]').checked = true;"; echo "\n\t\t\tdocument.getElementById('theme__banner[theme_banner4][status]').checked = true;"; echo "\n\t\t\tdocument.getElementById('theme__banner[theme_banner5][status]').checked = true;"; echo "\n\t\t\tdocument.getElementById('theme__banner[theme_banner6][status]').checked = true;"; echo "\n\t\t}else{"; echo "\n\t\t\tdocument.getElementById('theme__banner[theme_banner1][status]').checked = false;"; echo "\n\t\t\tdocument.getElementById('theme__banner[theme_banner2][status]').checked = false;"; echo "\n\t\t\tdocument.getElementById('theme__banner[theme_banner3][status]').checked = false;"; echo "\n\t\t\tdocument.getElementById('theme__banner[theme_banner4][status]').checked = false;"; echo "\n\t\t\tdocument.getElementById('theme__banner[theme_banner5][status]').checked = false;"; echo "\n\t\t\tdocument.getElementById('theme__banner[theme_banner6][status]').checked = false;"; echo "\n\t\t}"; echo "\n\t}"; echo "\n</script>"; echo "\n<div class=\"wrap\">"; echo "\n<p id=\"icon-options-general\" class=\"icon32\"><h2>".$themename." _e("theme settings","language"); "</h2></p><br/>"; echo "\n<form method=\"post\">"; echo "\n<p class=\"submit\" style=\"border:0px;padding:0px;\">"; echo "\n\t<input class=\"button-primary\" type=\"submit\" name=\"saveButton\" value=\"" _e("Save settings","language"); echo "\" />"; echo "\n\t<input class=\"button\" name=\"resetButton\" type=\"submit\" value=\"" _e("Reset settings","language"); echo "\" /><br/>"; echo "\n</p>"; echo "\n<br><table class=\"widefat\"><thead><tr><th style='font-size:14px;font-weight:normal;font-style:normal;padding-left:10px;'>" _e("Theme Style","language"); "</th></tr></thead>"; echo "\n\t\t<tbody><tr><th >" _e("Select your Style","language"); ""; echo "\n\t\t\t<select name=\"".$shortname."_css\" id=\"".$shortname."_css\">";while(list(, $f) = each($cssFiles)){ echo "\n\t\t\t\t<option value=\"".$f."\" ".((get_option( $shortname."_css" )==$f)?"selected":"").">".$f."</option>";} echo "\n\t\t\t</select>"; echo "\n</td></th></tr></tbody></table>"; echo "\n<table class=\"form-table\">"; echo "\n\t<tr valign=\"top\">"; echo "\n\t\t<br><table class=\"widefat\"><thead><tr><th>" _e("Flickr Widget Setup","language"); "</th></tr></thead>"; echo "\n\t\t<tbody><tr><th>"; echo "\n<table class=\"form-table\">"; echo "\n\t<tr valign=\"top\">"; echo "\n\t\t<th scope=\"row\">User ID: </th>"; echo "\n\t\t<td>"; echo "\n\t\t\t<input name=\"".$shortname."_flickr[nsid]\" type=\"text\" id=\"".$shortname."_flickr[nsid]\" value=\"".get_flickrSettings('nsid')."\" size=\"20\" />"; echo "\n\t\t</td>"; echo "\n\t</tr>"; echo "\n\t\t<th>Display: </th>"; echo "\n\t\t<td>"; echo "\n\t\t\t<select name=\"".$shortname."_flickr[display]\" id=\"".$shortname."_flickr[display]\">"; for($x = 1; $x<= 10; $x++){ echo "\n\t\t\t\t<option value=\"".$x."\" ".((get_flickrSettings( "display" )==$x)?"selected":"").">".$x."</option>"; } echo "\n\t\t\t</select>"; echo "\n\t\t\t<select name=\"".$shortname."_flickr[displayType]\" id=\"".$shortname."_flickr[displayType]\">"; while(list(, $f) = each($flickrDisplayType)){ echo "\n\t\t\t\t<option value=\"".$f."\" ".((get_flickrSettings( "displayType" )==$f)?"selected":"").">".$f."</option>"; } echo "\n\t\t\t</select> Images "; echo "\n\t\t</td>"; echo "\n\t</tr>"; echo "\n</td></th></tr></tbody></table></table>"; echo "\n\t\t<br><table class=\"widefat\"><thead><tr><th>" _e("Music Player","language"); "</th></tr></thead>"; echo "\n\t\t<tbody><tr><th>"; echo "\n<table class=\"form-table\">"; echo "\n\t<tr valign=\"top\">"; echo "\n\t\t<th scope=\"row\">" _e("Enter your the URl of your song.","language"); "</th>"; echo "\n\t\t<td>"; echo "\n\t\t\t<input name=\"".$shortname."_musicplayerSumition\" type=\"text\" id=\"".$shortname."_musicplayerSumition\" value=\"".get_option($shortname.'_musicplayerSumition')."\" size=\"100\" />"; echo "\n\t\t</td>"; echo "\n\t</tr>"; echo "\n</td></th></tr></tbody></table></table>"; echo "\n\t\t<br><table class=\"widefat\"><thead><tr><th>" _e("Audio/Video Player Module","language"); "</th></tr></thead>"; echo "\n\t\t<tbody><tr><th>"; echo "\n<table class=\"form-table\">"; $videosArray = unserialize($options[0]["std"]); $x = 1; $bg = 'style="background: #f1f1f1;"'; while(list($videoIndex, $aVideo) = each($videosArray)){ $bg = ($bg == 'style="background: #f1f1f1;"') ? '' : 'style="background: #f1f1f1;"'; echo "\n\t<tr valign=\"top\" ".$bg.">"; echo "\n\t\t<td ".$bg.">"; echo "\n\t\t<dl>"; echo "\n\t\t\t<dt>" _e("Player Code","language"); "</dt>"; echo "\n\t\t\t<dd><textarea name=\"".$shortname."_video[".$videoIndex."][link]\" id=\"".$shortname."_video[".$videoIndex."][link]\" style=\"width: 550px; height: 120px;\">".stripslashes((get_videoSettings($videoIndex, "link")!="")?get_videoSettings($videoIndex, "link"):$aVideo[$videoIndex]["link"])."

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.220.0140.04212.42
5.4.210.0130.04312.42
5.4.200.0160.04112.42
5.4.190.0200.07112.42
5.4.180.0130.04912.42
5.4.170.0100.04512.43
5.4.160.0240.06812.42
5.4.150.0110.04412.42
5.4.140.0130.04412.11
5.4.130.0140.04112.09
5.4.120.0250.06012.05
5.4.110.0160.04312.05
5.4.100.0190.03612.05
5.4.90.0120.04212.05
5.4.80.0110.04512.05
5.4.70.0100.04312.04
5.4.60.0150.04312.04
5.4.50.0110.04512.05
5.4.40.0130.04512.04
5.4.30.0110.04512.03
5.4.20.0140.04312.03
5.4.10.0120.04912.03
5.4.00.0250.06011.53
5.3.270.0140.04212.72
5.3.260.0130.04312.72
5.3.250.0140.05012.72
5.3.240.0240.06512.72
5.3.230.0160.04112.71
5.3.220.0140.04312.68
5.3.210.0190.06512.68
5.3.200.0120.04712.68
5.3.190.0140.04712.68
5.3.180.0180.04912.68
5.3.170.0160.05212.68
5.3.160.0140.05012.68
5.3.150.0160.04112.68
5.3.140.0130.04312.67
5.3.130.0200.07912.66
5.3.120.0130.05212.66
5.3.110.0180.07412.66
5.3.100.0100.04712.14
5.3.90.0100.04312.12
5.3.80.0110.04712.11
5.3.70.0100.04312.11
5.3.60.0200.06812.09
5.3.50.0120.04312.04
5.3.40.0140.04612.04
5.3.30.0150.05212.00
5.3.20.0140.04111.78
5.3.10.0120.04211.75
5.3.00.0140.04411.73

preferences:
145.9 ms | 1394 KiB | 7 Q