3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $guardian = <<<'BAZ' <!DOCTYPE html> <html> <head> <title> Latest news, sport and comment from the Guardian | The Guardian </title> <meta property="fb:app_id" content="180444840287"/> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"/> <link rel="canonical" href="http://www.theguardian.com/uk" /> <meta name="description" content="Latest news, sport, business, comment, analysis and reviews from the Guardian, the world's leading liberal voice" /> <meta name="DC.date.issued" content="2007-04-28"> <meta name="llt" content="AUnrek/w" /> <meta name="keywords" content="Network front" /> <meta name="news_keywords" content="Network front" /> <link rel="shortcut icon" href="http://static.guim.co.uk/favicon.ico" type="image/x-icon" /> <meta name="application-name" content="The Guardian"/> <meta name="msapplication-TileColor" content="#004983"/> <meta name="msapplication-TileImage" content="http://static.guim.co.uk/static/b6c135ec8e49127c7c87055af29b2d52c4011fc0/common/images/favicons/windows_tile_144_b.png"/> <link rel="shorturl" href="http://gu.com/p/pvj" /> <meta name="content-id" content="/uk"/> <link rel="publisher" href="https://plus.google.com/113000071431138202574"/> <meta name="p:domain_verify" content="4f4576e6bac27d86fd926c4579b97f23"/> <meta name="pocket-site-verification" content="be6d97bc1f6961ce6348e7ced4f1f4" /> <link href="http://feeds.theguardian.com/theguardian/uk/rss" rel="alternate" type="application/rss+xml" title="rss" /> <link rel="stylesheet" type="text/css" href="http://static.guim.co.uk/static/b6c135ec8e49127c7c87055af29b2d52c4011fc0/common/styles/network-front-grid.css" media="all" /> <link rel="stylesheet" type="text/css" href="http://static.guim.co.uk/static/b6c135ec8e49127c7c87055af29b2d52c4011fc0/zones/news/styles/zone-accent.css" media="screen" class="contrast" /> <link rel="stylesheet" type="text/css" href="http://static.guim.co.uk/static/b6c135ec8e49127c7c87055af29b2d52c4011fc0/zones/news/styles/grid-zone-accent.css" media="screen" class="contrast" /> <!--[if lte IE 6]> <link rel="stylesheet" type="text/css" href="http://static.guim.co.uk/static/b6c135ec8e49127c7c87055af29b2d52c4011fc0/zones/news/styles/zone-navigation-ie.css" media="screen" class="contrast" /> <![endif]--> <!--[if lte IE 9]> <script src="http://static.guim.co.uk/static/b6c135ec8e49127c7c87055af29b2d52c4011fc0/common/external-scripts/html5enable.js"></script> <![endif]--> <link rel="stylesheet" type="text/css" href="http://combo.guim.co.uk/b6c135ec8e49127c7c87055af29b2d52c4011fc0/common/styles/base-typography+common/styles/carousel+common/styles/commercial-partners+common/styles/grid-pixies+common/styles/grid/editable-trailblock+common/styles/header-local-info+common/styles/news-trails+common/styles/r3-component+common/styles/simple-news-direct+common/styles/sublink-liveblog+common/styles/ticker+common/styles/top-navigation+common/styles/trail-mugshot+common/styles/ventures-slot-machine+common/styles/weather-header.css" /> <link rel="stylesheet" type="text/css" href="http://combo.guim.co.uk/b6c135ec8e49127c7c87055af29b2d52c4011fc0/m-482~public/css/jobs-box-4.css" /> <link rel="stylesheet" type="text/css" href="http://static.guim.co.uk/static/b6c135ec8e49127c7c87055af29b2d52c4011fc0/common/styles/shame.css"/> <style> .component h2 { color: #ab1700; } .component h3 { font-size: 18px; line-height: 21px; } #footer { border-top-width: 3px; } </style> <style type="text/css"> #inner-wrapper { background-image: url(http://static.guim.co.uk/static/b6c135ec8e49127c7c87055af29b2d52c4011fc0/common/styles/images/nfBackground.gif); background-repeat: repeat-y; background-position: left top; border-bottom: 20px solid white; overflow: hidden; display: inline-block; zoom: 1; } </style> <script type="text/javascript"> //<![CDATA[ if (!commonStaticRoot) { var commonStaticRoot = "http://static.guim.co.uk/static/b6c135ec8e49127c7c87055af29b2d52c4011fc0/common/"; } if (!sectionStaticRoot) { var sectionStaticRoot = "http://static.guim.co.uk/static/b6c135ec8e49127c7c87055af29b2d52c4011fc0/networkfront/"; } if (!staticHost) { var staticHost="http://www.guardian.co.uk/"; } if (!sitePrefixUrl) { var sitePrefixUrl = "http://www.theguardian.com"; } if(!discussionApiUrl) { var discussionApiUrl = "http://discussion.guardianapis.com"; } //]]> </script> <script> var guardian = { r2: { comScoreVideoEnabled: true, dfpEnabled: true, liveEnvironment: true }, page: { contentId: '/uk', type: 'network front', contentTypes : '', livePage: false , section: 'networkfront', zone: 'news', edition: 'UK', productionOffice: 'UK', showAdverts: false, showRelated: true , showCommercialRelated: true, contributorIds: [ ] }, user: { edition: 'uk' }, capabilities: { localStorage: (function() { try { localStorage.setItem("gdn-test", "test-item"); localStorage.removeItem("gdn-test"); return true; } catch (e) { return false; } })() }, keys: { socialOverlay: "gdn.r2.social.overlay.stop" } }; </script> <script type='text/javascript'> // Chartbeat timing variable var _sf_startpt=(new Date()).getTime(); </script> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script> <script>window.jQuery || document.write('<script src="http://pasteup.guim.co.uk/js/lib/jquery/1.8.1/jquery.min.js">\x3C/script>')</script> <script src="http://pasteup.guim.co.uk/js/lib/jquery.cookie/1.2/jquery.cookie.min.js"></script> <script src="http://pasteup.guim.co.uk/js/lib/jquery.writecapture/1.0.5/jquery.writecapture.min.js"></script> <script> var jQ = jQuery.noConflict(); jQ.ajaxSetup({ cache: true }); </script> <script> var getCookieValue = function (cookieName) { var regexp = new RegExp(cookieName + "=([^;]*)") var cookieMatch = document.cookie.match(regexp); if (cookieMatch && cookieMatch.length > 1) { return unescape(cookieMatch[1]); } return ""; } var revSciString = (function() { var hasStorage = (function() { try { localStorage.setItem("xxx_localstorage_test", "xxx_localstorage_test"); localStorage.removeItem("xxx_localstorage_test"); return true; } catch(e) { return false; } }()); if (hasStorage && true && localStorage.getItem('rsi_segs_csv')) { return localStorage.getItem('rsi_segs_csv'); } else { return getCookieValue("rsi_segs_csv"); } }()); OAS_listpos = ''; OAS_query = 'cf=&pid=&pt=networkfront&'; // hold references to all videos on page var jwVideoPlayers = []; </script> <script type='text/javascript'> function crtg_getCookie(a){var b,c,d,e=document.cookie.split(";");for(b=0;b<e.length;b++){c=e[b].substr(0,e[b].indexOf("="));d=e[b].substr(e[b].indexOf("=")+1);c=c.replace(/^\s+|\s+$/g,"");if(c==a){return unescape(d)}}return""}var crtg_nid="1476";var crtg_cookiename="cto2_guardian";var crtg_content=crtg_getCookie(crtg_cookiename);var crtg_rnd=Math.floor(Math.random()*99999999999);var crtg_url="http://rtax.criteo.com/delivery/rta/rta.js?netid="+escape(crtg_nid);crtg_url+="&cookieName="+escape(crtg_cookiename);crtg_url+="&rnd="+crtg_rnd;crtg_url+="&varName=crtg_content";var crtg_script=document.createElement("script");crtg_script.type="text/javascript";crtg_script.src=crtg_url;crtg_script.async=true;if(document.getElementsByTagName("head").length>0)document.getElementsByTagName("head")[0].appendChild(crtg_script);else if(document.getElementsByTagName("body").length>0)document.getElementsByTagName("body")[0].appendChild(crtg_script)</script> <script type='text/javascript'> var gptadslots = []; var googletag = googletag || {}; googletag.cmd = googletag.cmd || []; (function () { var gads = document.createElement('script'); gads.async = true; gads.type = 'text/javascript'; var useSSL = 'https:' == document.location.protocol; gads.src = (useSSL ? 'https:' : 'http:') + '//www.googletagservices.com/tag/js/gpt.js'; var node = document.getElementsByTagName('script')[0]; node.parentNode.insertBefore(gads, node); })(); </script> <script type="text/javascript"> var targetSegments = function(segmentsString) { var targetingVars = {}; jQ(segmentsString.split("&")).each(function (idx, segment) { var kv = segment.split("="); if (typeof kv[1] !== 'undefined') { if (kv[0] in targetingVars) { targetingVars[kv[0]].push(kv[1]); } else { targetingVars[kv[0]] = [kv[1]]; } } }); for(v in targetingVars) { googletag.cmd.push(function () { googletag.pubads().setTargeting(v, targetingVars[v]); }); } } googletag.cmd.push(function () { googletag.pubads().enableSingleRequest(); googletag.pubads().enableAsyncRendering(); googletag.pubads().collapseEmptyDivs(); targetSegments("cf=&pid=&pt=networkfront&"); googletag.pubads().setTargeting("url", "/uk".replace(/\+/g, '-')); googletag.pubads().setTargeting("edition", "uk"); googletag.pubads().setTargeting("p", "r2"); targetSegments(crtg_content); googletag.pubads().setTargeting("a", revSciString.split(',').slice(0,40)); googletag.pubads().setTargeting("gdncrm", []); var gdnCrmSegs = "&"; var guardian = guardian || {}; guardian.r2 = guardian.r2 || {}; guardian.r2.revsci = guardian.r2.revsci || {}; guardian.r2.revsci.adData = [ ]; try { localStorage.setItem('gdncrmparams', gdnCrmSegs); } catch(er) { // Ignore exception } var adtest = getCookieValue("adtest"); if (adtest.length > 0) { googletag.pubads().setTargeting("at", adtest); } googletag.pubads().addEventListener('slotRenderEnded', function (event) { var divId = event.slot.getSlotId().getDomId(); if (divId === "dfp-top" && !event.isEmpty) { var width = event.size[0]; if (width === 970) { document.getElementById("dfp-top").style.marginLeft = "-15px"; } } else if (divId === "dfp-merch1") { var merchIframe = document.getElementById(divId).getElementsByTagName('iframe')[0]; var slotJson = merchIframe.contentWindow.TopRightJSON; showNFMerchandisingTopRight(slotJson); jQ(merchIframe).remove(); } else if (divId === "dfp-merch2") { var merchIframe = document.getElementById(divId).getElementsByTagName('iframe')[0]; var slotJson = merchIframe.contentWindow.BottomRightJSON; showNFMerchandisingBottomRight(slotJson); jQ(merchIframe).remove(); } else if (divId === "dfp-sf") { var sfIframe = document.getElementById(divId).getElementsByTagName('iframe')[0]; var slotJson = sfIframe.contentWindow.sponJSON; showSponsoredFeaturex31(slotJson); jQ(sfIframe).remove(); } }); googletag.enableServices(); }); </script> <script src="http://static.guim.co.uk/static/b6c135ec8e49127c7c87055af29b2d52c4011fc0/common/scripts/gu-core.js"></script> <script> var thirdPartyReferralCookieService = new guardian.r2.ThirdPartyReferralCookieService(); thirdPartyReferralCookieService.setThirdPartyReferralCookie(); var communitiesSite = false; guardian.r2.resourceRoot = "http://resource.guim.co.uk/"; var pageUrl = "http://www.theguardian.com/uk"; var RESOURCE_ROOT = 'http://resource.guim.co.uk/'; </script> <script src="//pasteup.guim.co.uk/js/lib/requirejs/2.1.5/require.min.js" data-main="http://static.guim.co.uk/static/b6c135ec8e49127c7c87055af29b2d52c4011fc0/common/scripts/main.js" data-modules="gu/author-twitter-handles, http://id.guim.co.uk/static/cs/js/guardian.identity.clientside-toolkit.js" data-callback="" id="require-js"></script> <script type="text/javascript"> //<![CDATA[ function insertStyleSheet(href) { var styleObject = document.createElement('link'); styleObject.setAttribute('href', commonStaticRoot + href); styleObject.setAttribute('type', 'text/css'); styleObject.setAttribute('media', 'screen'); styleObject.setAttribute('rel', 'stylesheet'); var head = document.getElementsByTagName('head')[0]; head.appendChild(styleObject); } insertStyleSheet('styles/js-on.css'); insertPluckStylesheet = true; //]]> </script> <script type='text/javascript'> ensurePackage('guardian.r2.omniture'); guardian.r2.omniture.isAvailable = function(){ return true; } </script> </head> <body class="network-front"> <div class="twelve-col" id="wrapper"> <div id="header"> <div class="top-navigation twelve-col top-navigation-js"> <div class="user-functions"> <div id="video-settings"> <div class="cookied"> <p class="on"><a class="autoplay-off" href="#skiplinks">Turn autoplay off</a></p> <p class="off"><a class="autoplay-on" href="#skiplinks">Turn autoplay on</a></p> </div> <div class="not-cookied"> <p>Please activate cookies in order to turn autoplay off</p> </div> </div> <div id="skiplinks"> <ul> <li><a href="#box" accesskey="s">Jump to content [s]</a></li> <li><a href="#global-nav" accesskey="0">Jump to site navigation [0]</a></li> <li><a href="#searchbeta" accesskey="4">Jump to search [4]</a></li> <li><a href="http://www.theguardian.com/help/terms-of-service" accesskey="8">Terms and conditions [8]</a></li> </ul> </div> <div id="edition-selector"> <div id="drop-down-edition" class="change-to-us" tabindex="20"> <h2>Edition:</h2> <span class="UK current-edition">UK</span> <span class="US"><a href="http://www.theguardian.com/edition-permission/us">US</a></span> <span class="AU"><a href="http://www.theguardian.com/edition-permission/au">AU</a></span> </div> </div> <div class="user-details"> <div class="drop-down id-profile-links initially-off"> <h2 class="id-populate-with-display-name"></h2> <ul> <li><a href="https://id.theguardian.com/profile/?returnUrl=http://www.theguardian.com/uk">Your activity</a></li> <li><a href="https://id.theguardian.com/email/list?returnUrl=http://www.theguardian.com/uk">Email subscriptions</a></li> <li><a href="https://id.theguardian.com/dashboard?returnUrl=http://www.theguardian.com/uk">Account details</a></li> <li><a href="https://id.theguardian.com/linked-services?returnUrl=http://www.theguardian.com/uk">Linked services</a></li> <li><a href="https://id.theguardian.com/signout?returnUrl=http://www.theguardian.com/uk">Sign out</a></li> </ul> </div> <noscript> <span><a href="https://id.theguardian.com/dashboard?returnUrl=http://www.theguardian.com/uk">Profile</a></span> </noscript> <span class='id-sign-in-top-nav initially-off'><a></a></span> <span class="trackable-component" style="background-color:#4bc6df" data-component="ngw-optin"><a href="/preference/platform/mobile?page=http%3A%2F%2Fwww.theguardian.com%2Fuk%3Fview%3Dmobile%23opt-in-message" style="color:white" class="switch-to-mobile" data-link-name="Switch to beta" rel="nofollow">Beta</a></span> </div> <div id="drop-down-1" class="drop-down" tabindex="21"> <h2> About us </h2> <ul> <li> <a href="http://www.theguardian.com/info" class="link-text">About us,</a> </li> <li> <a href="http://www.theguardian.com/help/contact-us" class="link-text">Contact us</a> </li> <li> <a href="http://www.theguardian.com/gnm-press-office" class="link-text">Press office</a> </li> <li> <a href="http://www.theguardian.com/gpc" class="link-text">Guardian Print Centre</a> </li> <li> <a href="http://www.theguardian.com/theguardian/page/readerseditor" class="link-text">Guardian readers' editor</a> </li> <li> <a href="http://www.theguardian.com/observer-readers-editor" class="link-text">Observer readers' editor</a> </li> <li> <a href="http://www.theguardian.com/help/terms-of-service" class="link-text">Terms of service</a> </li> <li> <a href="http://www.theguardian.com/help/privacy-policy" class="link-text">Privacy policy</a> </li> <li> <a href="http://www.theguardian.com/advertising" class="link-text">Advertising guide</a> </li> <li> <a href="http://www.theguardian.com/archive" class="link-text">Digital archive</a> </li> <li> <a href="http://guardian.newspaperdirect.com/epaper/viewer.aspx" class="link-text">Digital edition</a> </li> <li> <a href="http://www.theguardian.com/weekly" class="link-text">Guardian Weekly</a> </li> <li> <a href="http://3276.e-printphoto.co.uk/guardian" class="link-text">Buy Guardian and Observer photos</a> </li> </ul> </div> </div> <div class="other-functions"> <div id="drop-down-2" class="drop-down mirror" tabindex="22"> <h2> Today's paper </h2> <ul> <li> <a href="http://www.theguardian.com/theguardian" class="link-text">Main section</a> </li> <li> <a href="http://www.theguardian.com/theguardian/g2" class="link-text">G2 features</a> </li> <li> <a href="http://www.theguardian.com/theguardian/mainsection/commentanddebate" class="link-text">Comment and debate</a> </li> <li> <a href="http://www.theguardian.com/theguardian/mainsection/editorialsandreply" class="link-text">Editorials, letters and corrections</a> </li> <li> <a href="http://www.theguardian.com/tone/obituaries" class="link-text">Obituaries</a> </li> <li> <a href="http://www.theguardian.com/theguardian/series/otherlives" class="link-text">Other lives</a> </li> <li> <a href="http://www.theguardian.com/uk/sport" class="link-text">Sport</a> </li> <li> <a href="http://www.theguardian.com/theguardian/mainsection/society" class="link-text">SocietyGuardian</a> </li> <li> <a href="http://subscribe.theguardian.com/?INTCMP=R2_SIDEBAR_UK_GU_SUBSCRIBE" class="link-text">Subscribe</a> </li> </ul> </div> <div id="drop-down-3" class="drop-down-single mirror" tabindex="23"> <h2> <a href="http://subscribe.theguardian.com/?INTCMP=R2_TOPNAV_UK_GU_SUBSCRIBE" class="link-text">Subscribe</a> </h2> </div> </div> </div> <!-- Beginning Sync AdSlot --> <script type="text/javascript"> var topSlot; var dfpAdUnit = "/59666047/theguardian.com/uk/front/r2"; var sectionName = "Network front"; googletag.cmd.push(function () { // Ad slot declaration topSlot = googletag.defineSlot('/59666047/theguardian.com/uk/front/r2', [[728,90],[900,90],[940,230],[900,250],[970,250],[940,300]], 'dfp-top') .setTargeting('slot', ['top']) .addService(googletag.pubads()); }); </script> <div id='dfp-top' style='text-align:center'> <script type='text/javascript'> googletag.cmd.push(function() { googletag.display('dfp-top'); }); </script> </div> <!-- End AdSlot --> <div id="local-info"> <p class="accolade"> <span id="accolade" class=""><a href="http://www.theguardian.com/media/2014/apr/02/guardian-observer-glory-press-awards">Newspaper and website of the year</a> | <a href="http://www.theguardian.com/media/2014/apr/14/guardian-washington-post-pulitzer-nsa-revelations">Winner of the Pulitzer prize</a></span> | <span>26 November 2014</span> | Last updated one minute ago </p> <div class="top-search-box"> <div class="gcse-search"> <form action="http://www.google.com/search" class="placeholder-search-box"> <input type="hidden" name="as_sitesearch" value="theguardian.com"/> <input type="text" id="searchbox" name="q" placeholder="Your search terms" /> <input id="search-button" type="submit" value="Search" /> </form> </div> </div> </div> <div id="masthead" itemscope itemtype="http://schema.org/Organization"> <div id="guardian-logo" class="trackable-component" data-component="Network Front:logo"> <a itemprop="url" href="http://www.theguardian.com/uk"><img itemprop="logo" src="http://static.guim.co.uk/static/b6c135ec8e49127c7c87055af29b2d52c4011fc0/common/images/logos/the-guardian/titlepiece.gif" alt="The Guardian" width="287" /></a> </div> BAZ; function test($test) { return preg_replace_callback('@(["\'])((?!\1).)*\1(*SKIP)(*F)|\s+([A-z-:_]+?)(?=[\s/>])@si', function($test){ return "a"; }, $test); } echo test($guardian); echo "i didn't crash!"
based on 1GUG8
Output for 5.4.0 - 5.4.35
Parse error: syntax error, unexpected end of file, expecting ',' or ';' in /in/MZ86I on line 17
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Parse error: syntax error, unexpected $end, expecting ',' or ';' in /in/MZ86I on line 17
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_SL in /in/MZ86I on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_SL in /in/MZ86I on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/MZ86I on line 3
Process exited with code 255.