3v4l.org

run code in 300+ PHP versions simultaneously
<?php header('Content-type: text/html; charset=utf-8'); $my=$_GET['hl']=='my'; require_once('class.translate.php'); function sanitize_output($buffer) { $search = array( '/\>[^\S ]+/s', //strip whitespaces after tags, except space '/[^\S ]+\</s', //strip whitespaces before tags, except space '/(\s)+/s' // shorten multiple whitespace sequences ); $replace = array( '>', '<', '\\1' ); $buffer = preg_replace($search, $replace, $buffer); return $buffer; } if($my){ function translate_li($buffer){ $replace=translate_my($1); $buffer = preg_replace('/<li>(.*?)<\/li>/is', $replace, $buffer); return $buffer; } ob_start("translate_li"); } if(!$_GET['dev']){ ob_start("sanitize_output"); /*ob_end_flush();*/ } require_once('Minifier.php'); if($_GET['title']){ if($active=='home'){ $pagetitle=ucwords(str_replace("-"," ",$pagetitle)); } elseif($active=='services') { $pagetitle=ucwords(str_replace("-"," ",$_GET['title'])).' - '.$sitename; } $h1=ucwords(str_replace("-"," ",$h1)); $description=ucwords(str_replace("-"," ",$_GET['title'])).' - '.$description; $metakeywords=ucwords(str_replace("-"," ",$_GET['title'])).', '.$metakeywords; } if($active!=='home'){ $description=$pagetitle.' | '.$description; $metakeywords=$pagetitle.', '.$metakeywords; } if($my){ $metakeywords=translate_my($metakeywords); $description=translate_my($description); $pagetitle=translate_my($pagetitle); $h1=translate_my($h1); } function curPageURL() { $pageURL = 'http'; if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";} $pageURL .= "://"; if ($_SERVER["SERVER_PORT"] != "80") { $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; } else { $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; } return $pageURL; } $socialtitle = str_replace(" - ".$sitename," ",$pagetitle); ?> <!DOCTYPE html> <html itemscope="" itemtype="http://schema.org/WebPage" lang="en-US"> <head> <title><?=$pagetitle?></title> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta content="<?=$logo_notitle?>" itemprop="image" /> <meta name="description" content="<?=$description?>" /> <meta name="keywords" content="<?=$metakeywords?>" /> <base href="http://www.mynoblecare.com" /> <meta http-equiv="Content-Language" content="EN" /> <meta name="copyright" content="<?=$regname?>" /> <meta name="author" content="<?=$regname?>" /> <!--start social tags--> <!--Twitter meta tags--> <meta name="twitter:card" content="summary"> <meta name="twitter:site" content="@mynoblecare"> <meta name="twitter:title" content="<?=$socialtitle?>"> <meta name="twitter:description" content="<?=$description?>"> <meta name="twitter:image" content="<?=$logo_notitle?>"> <!-- Facebook meta tags--> <meta property="og:title" content="<?=$socialtitle?>" /> <meta property="og:site_name" content="<?=$sitename?>"/> <meta property="og:type" content="website" /> <meta property="og:image" content="<?=$logo_notitle?>" /> <meta property="og:url" content="<?=curPageURL()?>" /> <meta property="og:description" content="<?=$description?>" /> <!--end social tags--> <link rel="alternate" type="application/rss+xml" title="Noble Care Malaysia" href="http://feeds.feedburner.com/NobleCare"> <link rel="shortcut icon" type="image/x-icon" href="favicon.ico" /> <link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css' /> <style type="text/css"> <?php $css=file_get_contents('css/normalize.css'); if($_GET['m']=='1'){ $css.=file_get_contents('css/style_mini.css'); } else { $css.=file_get_contents('css/style.css'); $css.=file_get_contents('css/subscribe.css'); } if($active=='gallery'){ $css.=file_get_contents('css/gallery.css'); } $css.='.h5 { line-height: 25px; font-weight: 300;color: rgb(226, 4, 4) !important;font-family: Arial,Helvetica,tahoma sans-serif;padding-bottom: 5px;border-bottom: 1px solid rgb(255, 0, 0);}'; if($active=='home'){ $css.='.ic2 {background:#888;overflow:hidden;border-top:5px solid #888;border-bottom:5px solid #888;font-family:"Lucida Sans Unicode","Lucida Grande",sans-serif} .ic_inner {-moz-border-radius: 0px 42px 42px 0px;-webkit-border-radius: 0px 42px 42px 0px;border-radius: 0px 42px 42px 0px;background:rgb(247,247,247);padding:20px 20px 25px;padding-right: 150px;padding-left: 60px;transition:all 0.33s ease-in-out;-moz-transition:all 0.33s ease-in-out;-webkit-transition:all 0.33s ease-in-out;-o-transition:all 0.33 ease-in-out; overflow:hidden; } .ic-fb { background:url(/images/ic-social.png); float:left;width:48px;height:48px;background-position: 0px 0px;} .ic-fb:hover { width:48px;height:48px;background-position: 0px -58px;} .ic-tw { background:url(/images/ic-social.png);float:left;width:48px;height:48px;background-position: 0px -116px;} .ic-tw:hover { width:48px;height:48px;background-position: 0px -174px;} .c-a {transition:all 0.33s ease-in-out;-moz-transition:all 0.33s ease-in-out;-webkit-transition:all 0.33s ease-in-out;-o-transition:all 0.33 ease-in-out;background: rgba(255,255,255,.4);border-radius: 10px;padding: 5px; color:rgb(190, 1, 9) !important;position: relative;top: 170px;left: 10px;font-size: 2.5em;} .c-a:hover { background:rgba(247, 247, 247, 0.8);}'; } else { $css.='.content-body { padding:20px; } #content { border-top:none;} .breadcrumb a { color:#333;} .breadcrumb a:hover { color:rgb(226, 4, 4);}'; } if($styles){ $css.=$styles; } /* remove comments */ $css = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $css); /* remove tabs, spaces, newlines, etc. */ $css = str_replace(array("\r\n","\r","\n","\t",' ',' ',' '), '', $css); /* remove other spaces before/after ; */ $css = preg_replace(array('(( )+{)','({( )+)'), '{', $css); $css = preg_replace(array('(( )+})','(}( )+)','(;( )*})'), '}', $css); $css = preg_replace(array('(;( )+)','(( )+;)'), ';', $css); ?> <?=$css?> </style> <!--[if gte IE 9] <style type="text/css"> .gradient { filter: none; } </style> <![endif]--> <?php if($_GET['title']){ ?> <script type="text/javascript">window.location='http://www.mynoblecare.com';</script> <?php } ?> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script> <script type="text/javascript"> <?php $js=file_get_contents('js/js.js'); if($active=='appointment') { $js.='$.ajax({ url: "//code.jquery.com/ui/1.10.3/jquery-ui.js", dataType: "script", cache: true, success: function() { $( "#date" ).datepicker({ minDate: 0, maxDate: "+1M" }); $( "#date" ).datepicker( "option", "dateFormat", "DD, d MM, yy" ); $("head").append(\'<link href="//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css" />\'); } });'; } elseif($active=='gallery'){ $js.='$("head").append(\'<link href="css/lightbox.css" rel="stylesheet" type="text/css" />\'); $.ajax({ url: "js/modernizr.custom.js", dataType: "script", cache: true }); $.ajax({ url: "js/lightbox-2.6.min.js", dataType: "script", cache: true });'; } $js.=' $(\'input[type="submit"]\').on("click",function(){ $("#loading").ajaxStart(function(){ centerDiv("#loading"); $(".overlay").show(); $(this).show(); }).ajaxStop(function(){ $(".overlay").hide(); $(this).hide(); }); }); });'; if(!$_GET['title']){ $js.='$(window).load(function(){ $("html, body").animate({ scrollTop: $(".content-body").offset().top-10 },1000); $(".aloader").hide(); $(".ajaxlink").on("click",function(){ $(".aloader").show(); return true; }); });'; } $js = JShrink\Minifier::minify($js); /* remove tabs, spaces, newlines, etc. */ $js = str_replace(array("\r\n","\r","\n","\t",' ',' ',' '), '', $js); ?> <?=$js?> </script> </head> <body> <div style="text-indent:-99999px;"> <?=$socialtitle?> <?php $seotags=' old folks home malaysia nursing home services old folks home elderly care centre malaysia noble care noble care malaysia nursing care malaysia nursing care services nursing care services for old folks nursing care services rawang nursing care services selangor nursing care services malaysia nursing home malaysia nursing home for old folks nursing home for parents or grand parents nursing home selangor old age care services care for old folks old folks care services patient care services '; if($my){ $seotags=translate_my($seotags); } ?> <?=$seotags?> </div> <div style="overflow: hidden;text-align: center;z-index:9999999;position:absolute;border:1px solid #ddd;border-radius:10px;background:#fff;" id="loading" class="hide"> <img src="images/ajax-loader.gif" alt="loading" style="display:block;margin: 10px;" /> </div> <div class="aloader" style="position:fixed;right:10px;bottom:5px;"><img src="images/ajax-loader.gif" alt="Loading.." title="Loading" /></div> <noscript><style> .aloader { display:none } </style></noscript> <div class="overlay hide"></div> <div class="loader hide"> <div id="map_canvas"></div> <span class="btn-submit closemodal">Close</span> </div> <div class="container"> <div class="main"> <div class="header" id="header"> <a href="/" title="Noble Care"><img id="logo" alt="logo" title="<?=$sitename?>" src="images/logo_1.png" /></a> <ul class="menu"> <li<?php if($active=='home'){ echo ' class="active"'; } ?>><a class="ajaxlink" href="/">Home</a></li> <!-- <li class="<?php if($active=='centres'){ echo 'active '; } ?>headlink"><a class="ajaxlink" href="/centres" onclick="return false;">Our Centres</a> <ul> <li><a href="/centres/rawang" onclick="return false;">Rawang Centre</a></li> <li><a href="/centres/salayang" onclick="return false;">Salayang Centre</a></li> <li><a href="/centres/kualalumpur" onclick="return false;">Kualalumpur Centre</a></li> <li><a href="/centres/kalang" onclick="return false;">Klang Centre</a></li> <li><a href="/centres/ampang" onclick="return false;">Ampang Centre</a></li> <li><a href="/centres/petalingjaya" onclick="return false;">Petaling Jaya Centre</a></li> </ul> </li> --> <li<?php if($active=='services'){ echo ' class="active"'; } ?>><a class="ajaxlink" href="/services">Services</a></li> <li<?php if($active=='appointment'){ echo ' class="active"'; } ?>><a class="ajaxlink" href="/appointment">Appointments</a></li> <li<?php if($active=='gallery'){ echo ' class="active"'; } ?>><a class="ajaxlink" href="/gallery">Gallery</a></li> <li<?php if($active=='about'){ echo ' class="active"'; } ?>><a class="ajaxlink" href="/about">About Us</a></li> <li<?php if($active=='contact'){ echo ' class="active"'; } ?>><a class="ajaxlink" href="/contact">Contact Us</a></li> <li class="sp gradient">&nbsp;</li> <form id="searchForm" action="/search" method="GET"> <div class="s-input"> <input type="text" name="q" id="q" value="Search" /> </div> <input type="submit" id="searchSubmit" value="" /> </form> </ul> </div> <?php if($active=='home'){ ?> <?php if (isSet($_GET['msg'])){ echo "<div style='border-bottom: 1px dashed #F60;padding: 15px 20px 0px 20px;height: 32px;background-color: rgb(248, 240, 219);text-align:center;color:red;font-weight:bold;'>".htmlentities($_GET['msg'])."</div>"; } ?> <?php if (isSet($_GET['msg_gr'])){ echo "<div style='border-bottom: 1px dashed #F60;padding: 15px 20px 0px 20px;height: 32px;background-color: rgb(248, 240, 219);text-align:center;color:green;font-weight:bold;'>".htmlentities($_GET['msg_gr'])."</div>"; } ?> <div id="slider"> <a href="/forms/assessment-form" title="Assessment Form"><div class="left" style="height: 235px;width: 578px;"><img style="border:2px solid #ccc;" alt="assessment form noble care" src="http://www.mynoblecare.com/thumber.php?img=images/stethoscope_assessment-form.png&h=200&w=575" /></div></a> <a href="/our-care-services-pg" title="Our Caring Services"><div class="left" style="margin-left: 10px;width: 411px;background: url('http://www.mynoblecare.com/thumber.php?img=images/gallery/_MG_0784.JPG&h=232&w=415') no-repeat scroll 0% 0% transparent;font-family: 'Oswald';height: 232px;border: 2px solid #ccc;"><span class="c-a">Our Care Services</span></div></a> </div> <?php } ?> <div id="content"> <?php if($active!=='home'){ $pagetitle2=str_replace(' - '.$sitename, '', $pagetitle); echo '<div class="breadcrumb" style="color:#222;padding:10px;border-bottom:1px solid #ccc;"> You are here: '; if(!$subactive){ echo '<span itemscope itemtype="http://data-vocabulary.org/Breadcrumb"> <a href="http://www.mynoblecare.com" itemprop="url"><span itemprop="title">'.$sitename.'</span></a> &raquo; </span>'.$pagetitle2; } else { echo '<span itemscope itemtype="http://data-vocabulary.org/Breadcrumb"> <a href="http://www.mynoblecare.com" itemprop="url"><span itemprop="title">'.$sitename.'</span></a> &raquo; </span><span itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="'.dirname(curPageURL()).'" itemprop="url"> <span itemprop="title">'.ucwords($active).'</span> </a> &raquo; </span>'.$pagetitle2; } echo '</div>'; } ?> <div class="content-body" <?php if($active=='home'){ echo 'style="width:100%"'; } ?>> <?php if($active=='home'){ ?> <div style="text-align:center;"><h1 style="box-shadow:none;"><?=$h1?></h1></div> <?php } ?>

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.200.0090.04312.40
5.4.190.0130.03812.39
5.4.180.0070.04312.40
5.4.170.0100.04312.40
5.4.160.0150.04412.40
5.4.150.0120.04712.39
5.4.140.0160.03612.08
5.4.130.0110.04312.06
5.4.120.0100.04112.03
5.4.110.0160.05112.03
5.4.100.0110.04012.03
5.4.90.0100.04212.03
5.4.80.0140.05412.03
5.4.70.0130.04112.03
5.4.60.0110.04012.03
5.4.50.0120.03812.02
5.4.40.0120.03812.01
5.4.30.0140.05912.01
5.4.20.0130.04612.00
5.4.10.0120.04412.01
5.4.00.0100.04811.50
5.3.270.0160.04612.72
5.3.260.0110.04712.72
5.3.250.0100.04412.71
5.3.240.0120.04212.72
5.3.230.0150.03912.71
5.3.220.0140.04312.68
5.3.210.0120.04512.68
5.3.200.0140.04012.68
5.3.190.0120.04212.67
5.3.180.0190.06512.68
5.3.170.0130.04512.67
5.3.160.0140.04712.67
5.3.150.0160.03812.67
5.3.140.0150.03912.66
5.3.130.0100.04612.66
5.3.120.0190.06512.66
5.3.110.0200.06412.66
5.3.100.0130.04012.12
5.3.90.0130.03912.10
5.3.80.0110.04212.09
5.3.70.0120.04112.09
5.3.60.0120.04312.07
5.3.50.0110.04212.02
5.3.40.0120.04112.02
5.3.30.0130.03811.98
5.3.20.0100.04311.76
5.3.10.0120.03811.72
5.3.00.0130.03711.71

preferences:
139.21 ms | 1386 KiB | 7 Q