3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $regex = '(?<=\s)(\w+)\s*\(([^(]+|.*?\(.*?\).*?)\)\s*\{'; $test_string = '<br> (function() {<br> window.google = {<br> kEI:""STRING"", getEI:function(a) {<br> for(var b;<br> a ""SYMBOL""""SYMBOL"" (!a.getAttribute || !(b = a.getAttribute(""STRING"")));<br> )a = a.parentNode;<br> return b || google.kEI<br> }, https:function() {return""STRING"" == window.location.protocol}, kEXPI:""STRING"", kCSI: {e:""STRING"", ei:""STRING""}, authuser:0, ml:function() {}, kHL:""STRING"", time:function() {return(new Date).getTime()}, log:function(a, b, c, k, l) {<br> var d = new Image, f = google.lc, e = google.li, g = ""STRING"", h = ""STRING"";<br> d.onerror = d.onload = d.onabort = function() {delete f[e]};<br> f[e] = d;<br> c || - 1 != b.search(""STRING"") || (g = ""STRING"" + google.getEI(k));<br> c = c || ""STRING"" + (l || ""STRING"") + ""STRING"" + a + ""STRING"" + b + g + h + ""STRING"" + google.time();<br> a = ""STRING""i;<br> a.test(c) ""SYMBOL""""SYMBOL"" google.https()?(google.ml(Error(""STRING""), !1, {src:c}), delete f[e]):(d.src = c, google.li = e + 1)<br> }, lc:[], li:0, j: {en:1, b:!!location.hash ""SYMBOL""""SYMBOL"" !!location.hash.match(""STRING""), bv:21, pm:""STRING"", u:""STRING""}, y: {}, x:function(a, b) {<br> google.y[a.id] = [a, b];<br> return!1<br> }, load:function(a, b, c) {<br> google.x ({id:a + m++}, function() {google.load(a, b, c)})<br> }<br> };<br> var m = 0;<br> })();<br> (function() {<br> google.sn = ""STRING"";<br> google.timers = {};<br> google.startTick = function(a, b) {<br> var f = google.time();<br> google.timers[a] = {<br> t: {start:f}, bfr:!!b<br> };<br> };<br> google.tick = function(a, b, f) {<br> google.timers[a] || google.startTick(a);<br> google.timers[a].t[b] = f || google.time()<br> };<br> google.startTick(""STRING"", !0);<br> try {<br> google.pt = window.chrome ""SYMBOL""""SYMBOL"" window.chrome.csi ""SYMBOL""""SYMBOL"" Math.floor(window.chrome.csi().pageT);<br> }<br> catch(d) {}<br> })();<br> (function() {<br> ""STRING"";<br> var h = this, l = Date.now || function() {return + new Date};<br> var t = Array.prototype, v = t.indexOf?function(d, c, a) {return t.indexOf.call(d, c, a)} :function(d, c, a) {<br> a = null == a?0:0 ""SYMBOL"" a?Math.max(0, d.length + a):a;<br> if(""STRING"" == typeof d)return""STRING"" == typeof c ""SYMBOL""""SYMBOL"" 1 == c.length?d.indexOf(c, a): - 1;<br> for(;<br> a ""SYMBOL"" d.length;<br> a++)if(a in d ""SYMBOL""""SYMBOL"" d[a] === c)return a;<br> return - 1<br> };<br> var w = function(d, c) {<br> return function(a) {<br> a || (a = window.event);<br> return c.call(d, a)<br> }<br> }, x = ""STRING"" != typeof navigator ""SYMBOL""""SYMBOL"" ""STRING"".test(navigator.userAgent), y = ""STRING"" != typeof navigator ""SYMBOL""""SYMBOL"" !""STRING"".test(navigator.userAgent) ""SYMBOL""""SYMBOL"" ""STRING"".test(navigator.userAgent), A = {A:13, BUTTON:0, CHECKBOX:32, COMBOBOX:13, LINK:13, LISTBOX:13, MENU:0, MENUBAR:0, MENUITEM:0, MENUITEMCHECKBOX:0, MENUITEMRADIO:0, OPTION:13, RADIO:32, RADIOGROUP:32, RESET:0, SUBMIT:0, TAB:0, TABLIST:0, TREE:13, TREEITEM:13}, B = [""STRING"", ""STRING"", ""STRING""];<br> var D = function() {<br> this.v = [];<br> this.i = [];<br> this.o = [];<br> this.w = {};<br> this.k = null;<br> this.p = [];<br> C(this, ""STRING"")<br> }, E = ""STRING"" != typeof navigator ""SYMBOL""""SYMBOL"" ""STRING"".test(navigator.userAgent), F = ""STRING"", H = function(d, c) {<br> return function(a) {<br> var b = c;<br> if(""STRING"" == b) {<br> if(!a.detail || !a.detail._type)return;<br> b = a.detail._type<br> }<br> var e;<br> if(""STRING"" == b ""SYMBOL""""SYMBOL"" (x ""SYMBOL""""SYMBOL"" a.metaKey || !x ""SYMBOL""""SYMBOL"" a.ctrlKey || 2 == a.which || null == a.which ""SYMBOL""""SYMBOL"" 4 == a.button || a.shiftKey))b = ""STRING"";<br> else {<br> var f = a.which || a.keyCode || a.key;<br> y ""SYMBOL""""SYMBOL"" 3 == f ""SYMBOL""""SYMBOL"" (f = 13);<br> e = a.srcElement || a.target;<br> var m = (e.getAttribute(""STRING"") || e.type || e.tagName).toUpperCase(), g = 13 == f || 32 == f, k;if(k = ""STRING"" == a.type)k = (e.getAttribute(""STRING"") || e.type || e.tagName).toUpperCase(), k = ""STRING"" != k ""SYMBOL""""SYMBOL"" ""STRING"" != k ""SYMBOL""""SYMBOL"" ""STRING"" != k ""SYMBOL""""SYMBOL"" ""STRING"" != k ""SYMBOL""""SYMBOL"" (""STRING"" != k || ""STRING"" != e.tagName.toUpperCase()) ""SYMBOL""""SYMBOL"" !e.isContentEditable;var s = ""STRING"" == e.tagName.toUpperCase() ""SYMBOL""""SYMBOL"" !e.type, p = 0 == A[m] % f, f = !(m in A) ""SYMBOL""""SYMBOL"" 13 == f;e = !!a.originalTarget ""SYMBOL""""SYMBOL"" a.originalTarget != e;k ""SYMBOL""""SYMBOL"" !(a.ctrlKey || a.shiftKey || a.altKey || a.metaKey) ""SYMBOL""""SYMBOL"" g ""SYMBOL""""SYMBOL"" ((p || f) ""SYMBOL""""SYMBOL"" !s || e) ""SYMBOL""""SYMBOL"" (b = ""STRING"")}k = a.srcElement || a.target;var g = G(b, a, k, ""STRING"", null), n;for(e = k;e ""SYMBOL""""SYMBOL"" e != this;e = e.__owner || e.parentNode){f = s = e;n = b;p = f.__jsaction;if(!p ""SYMBOL""""SYMBOL"" (p = {}, f.__jsaction = p, m = void 0, m = null, ""STRING""in f ""SYMBOL""""SYMBOL"" (m = f.getAttribute(""STRING"")), m))for(var f = m.split(F), m = 0, M = f?f.length:<br> 0;<br> m ""SYMBOL"" M;<br> m++) {<br> var q = f[m];<br> if(q) {<br> var u = q.indexOf(""STRING""), z = -1 != u, N = z?q.substr(0, u).replace(""STRING"", ""STRING"").replace(""STRING"", ""STRING""):""STRING"", q = z?q.substr(u + 1).replace(""STRING"", ""STRING"").replace(""STRING"", ""STRING""):q;<br> p[N] = q<br> }<br> }<br> ""STRING"" == n?n = ""STRING"":""STRING"" != n || p.click || (n = ""STRING"");<br> n = {s:n, action:p[n] || ""STRING"", D:!1};<br> g = G(n.s, a, k, n.action || ""STRING"", s, g.timeStamp);<br> if(n.D || n.action)break<br> }<br> if(n ""SYMBOL""""SYMBOL"" n.action) {<br> if(b = ""STRING"" == b)b = a.srcElement || a.target, b = (b.type || b.tagName).toUpperCase(), (b = 32 == (a.which || a.keyCode || a.key) ""SYMBOL""""SYMBOL"" ""STRING"" != b) || (b = a.srcElement || a.target, e = (b.getAttribute(""STRING"") || b.tagName).toUpperCase(), b = b.type, !(e = ""STRING"" == e) ""SYMBOL""""SYMBOL"" (e = !!b) ""SYMBOL""""SYMBOL"" (e = !(0 ""SYMBOL""= v(B, b.toUpperCase()))), b = e);b ""SYMBOL""""SYMBOL"" (a.preventDefault?a.preventDefault():<br> a.returnValue = !1)<br> }<br> else g.action = ""STRING"", g.actionElement = null;<br> b = g;<br> d.k ""SYMBOL""""SYMBOL"" (g = G(b.eventType, b.event, b.targetElement, b.action, b.actionElement, b.timeStamp), ""STRING"" == g.eventType ""SYMBOL""""SYMBOL"" (g.eventType = ""STRING""), d.k(g, !0));<br> if(b.actionElement)if(""STRING"" == b.actionElement.tagName ""SYMBOL""""SYMBOL"" ""STRING"" == b.eventType ""SYMBOL""""SYMBOL"" (a.preventDefault?a.preventDefault():a.returnValue = !1), d.k)d.k(b);<br> else {<br> var r;<br> if((g = h.document) ""SYMBOL""""SYMBOL"" !g.createEvent ""SYMBOL""""SYMBOL"" g.createEventObject)try {r = g.createEventObject(a)} catch(R) {r = a} else r = a;<br> b.event = r;<br> d.p.push(b)<br> }<br> }<br> }, G = function(d, c, a, b, e, f) {<br> return {eventType:d, event:c, targetElement:a, action:b, actionElement:e, timeStamp:f || l()}<br> }, I = function(d, c) {<br> return function(a) {<br> var b = d, e = c, f = !1;<br> ""STRING"" == b?b = ""STRING"":""STRING"" == b ""SYMBOL""""SYMBOL"" (b = ""STRING"");<br> if(a.addEventListener) {<br> if(""STRING"" == b || ""STRING"" == b || ""STRING"" == b || ""STRING"" == b)f = !0;<br> a.addEventListener(b, e, f)<br> }<br> else a.attachEvent ""SYMBOL""""SYMBOL"" (""STRING"" == b?b = ""STRING"":""STRING"" == b ""SYMBOL""""SYMBOL"" (b = ""STRING""), e = w(a, e), a.attachEvent(""STRING"" + b, e));<br> return {s:b, B:e, C:f}<br> }<br> }, C = function(d, c) {<br> if(!d.w.hasOwnProperty(c) ""SYMBOL""""SYMBOL"" ""STRING"" != c ""SYMBOL""""SYMBOL"" ""STRING"" != c) {<br> var a = H(d, c), b = I(c, a);<br> d.w[c] = a;<br> d.v.push(b);<br> for(a = 0;<br> a ""SYMBOL"" d.i.length;<br> ++a) {<br> var e = d.i[a];<br> e.k.push(b.call(null, e.i))<br> }<br> ""STRING"" == c ""SYMBOL""""SYMBOL"" C(d, ""STRING"")<br> }<br> };<br> D.prototype.B = function(d) {return this.w[d]};<br> var Q = function(d) {<br> var c = J, a = new K(d);<br> n: {<br> for(var b = 0;<br> b ""SYMBOL"" c.i.length;<br> b++)if(L(c.i[b].i, d)) {<br> d = !0;<br> break n<br> }<br> d = !1<br> }<br> if(d)c.o.push(a);<br> else {<br> O(c, a);<br> c.i.push(a);<br> a = c.o.concat(c.i);<br> d = [];<br> for(var b = [], e = 0;<br> e ""SYMBOL"" c.i.length;<br> ++e) {<br> var f = c.i[e];<br> if(P(f, a)) {<br> d.push(f);<br> for(var m = 0;<br> m ""SYMBOL"" f.k.length;<br> ++m) {<br> var g = f.i, k = f.k[m];<br> g.removeEventListener?g.removeEventListener(k.s, k.B, k.C):g.detachEvent ""SYMBOL""""SYMBOL"" g.detachEvent(""STRING"" + k.s, k.B)<br> }<br> f.k = []<br> }<br> else b.push(f)<br> }<br> for(e = 0;<br> e ""SYMBOL"" c.o.length;<br> ++e)f = c.o[e], P(f, a)?d.push(f):(b.push(f), O(c, f));<br> c.i = b;<br> c.o = d<br> }<br> }, O = function(d, c) {<br> var a = c.i;<br> E ""SYMBOL""""SYMBOL"" (a.style.cursor = ""STRING"");<br> for(a = 0;<br> a ""SYMBOL"" d.v.length;<br> ++a)c.k.push(d.v[a].call(null, c.i))<br> }, K = function(d) {<br> this.i = d;<br> this.k = []<br> }, P = function(d, c) {<br> for(var a = 0;<br> a ""SYMBOL"" c.length;<br> ++a)if(c[a].i != d.i ""SYMBOL""""SYMBOL"" L(c[a].i, d.i))return!0;<br> return!1<br> }, L = function(d, c) {<br> for(;<br> d != c ""SYMBOL""""SYMBOL"" c.parentNode;<br> )c = c.parentNode;<br> return d == c<br> };<br> var J = new D;<br> Q(window.document.documentElement);<br> C(J, ""STRING"");<br> C(J, ""STRING"");<br> C(J, ""STRING"");<br> C(J, ""STRING"");<br> C(J, ""STRING"");<br> C(J, ""STRING"");<br> C(J, ""STRING"");<br> C(J, ""STRING"");<br> C(J, ""STRING"");<br> C(J, ""STRING"");<br> C(J, ""STRING"");<br> C(J, ""STRING"");<br> C(J, ""STRING"");<br> C(J, ""STRING"");<br> C(J, ""STRING"");<br> C(J, ""STRING"");<br> C(J, ""STRING"");<br> window.google.jsad = function(d) {<br> var c = J;<br> c.k = d;<br> c.p ""SYMBOL""""SYMBOL"" (0 ""SYMBOL"" c.p.length ""SYMBOL""""SYMBOL"" d(c.p), c.p = null)<br> };<br> window.google.jsac = function(d) {Q(d)};<br> }).call(window);<br> (function() {<br> ""STRING"";<br> var f = this, g = function(d, c) {<br> var a = d.split(""STRING""), b = f;<br> a[0]in b || !b.execScript || b.execScript(""STRING"" + a[0]);<br> for(var e;<br> a.length ""SYMBOL""""SYMBOL"" (e = a.shift());<br> )a.length || void 0 === c?b[e]?b = b[e]:b = b[e] = {} :b[e] = c<br> };<br> var h = [], k = [];<br> g(""STRING"", h);<br> g(""STRING"", k);<br> g(""STRING"", function(d, c, a) {h.push([d, c, a])});<br> g(""STRING"", function(d) {<br> for(var c = 0, a;<br> a = h[c];<br> )d == a[1]?h.splice(c, 1):c++<br> });<br> g(""STRING"", function(d) {k.push(d)});<br> }).call(window);<br> google.arwt = function(a) {<br> a.href = document.getElementById(a.id.substring(1)).href;<br> return!0<br> };'; $test_string = str_replace('<br>', "\n", $test_string); echo "1:".md5(mb_ereg_replace('/'.$regex.'/',' $1 $2',$test_string))."\n"; echo "2:".md5(preg_replace('/'.$regex.'/u',' $1 $2',$test_string))."\n"; echo "3:".md5(preg_replace('/'.$regex.'/',' $1 $2',$test_string))."\n";
Output for 5.0.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
1:24a951110ef71f2b5a85abc2aed07c64 2:ed329f67ca4d8ad23fe54e0b18c802cc 3:ed329f67ca4d8ad23fe54e0b18c802cc
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.4 - 4.4.9
Warning: mb_ereg_replace(): mbregex compile err: undefined (?...) sequence in /in/E9VuS on line 5 1:d41d8cd98f00b204e9800998ecf8427e 2:ed329f67ca4d8ad23fe54e0b18c802cc 3:ed329f67ca4d8ad23fe54e0b18c802cc
Output for 4.3.2 - 4.3.3
Fatal error: Call to undefined function: mb_ereg_replace() in /in/E9VuS on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: mb_ereg_replace() in /in/E9VuS on line 5