3v4l.org

run code in 300+ PHP versions simultaneously
<?php function emote($source) { $emotes = array( '/(\:\))|(\:\=\))|(\:\-\))/' => 'smile', '/(\:\()|(\:\=\()|(\:\-\()/' => 'sadsmile', '/(\:D)|(\:\=D)|(\:\-D)/i' => 'bigsmile', '/(8\))|(8\=\))|(8\-\))|(B\))|(B\=\))|(B\-\))|(\(cool\))/i' => 'cool', '/(\:o)|(\:\=o)|(\:\-o)/i' => 'wink', '/(\;\()|(\;\-\()|(\;\=\()/' => 'crying', '/(\(sweat\))|(\(\:\|)/i' => 'sweating', '/(\:\|)|(\:\=\|)|(\:\-\|)/' => 'speechless', '/(\:\*)|(\:\=\*)|(\:\-\*)/' => 'kiss', '/:P:=P:-P/i' => 'tongueout', '/(\(blush\))|(\:\$)|(\:\-\$)|(\:\=\$)|(\:\"\>)/i' => 'blush', '/(\:\^\))/' => 'wondering', '/(\|\-\))|(\I\-\))|(\I\=\))|(\(snooze\))/i' => 'sleepy', '/(\|\()|(\|\-\()|(\|\=\()/' => 'dull', '/(\(inlove\))/i' => 'inlove', '/(\]\:\))|(>\:\))|(\(grin\))/i' => 'evilgrin', '/(\(talk\))/i' => 'talking', '/(\(yawn\))|(\|\-\(\))/i' => 'yawn', '/(\(puke\))|(\:\&)|(\:\-\&)|(\:\=\&)/i' => 'puke', '/(\(doh\))/i' => 'doh', '/(\:\@)|(\:\-\@)|(\:\=\@)|(\x\()|(\x\-\()|(\x\=\()/i' => 'angry', '/(\(wasntme\))/i' => 'wasntme', '/(\(party\))/i' => 'party', '/(\:S)|(\:\-S)|(\:\=S)/i' => 'worried', '/(\(mm\))|(\(mmm\))/i' => 'mmm', '/(8\-\|)|(B\-\|)|(8\|)|(B\|)|(8\=\|)|(B\=\|)|(\(nerd\))/i' => 'nerd', '/(\:x)|(\:\-x)|(\:\=x)|(\:\#)|(\:\-\#)|(\:\=\#)/i' => 'lipssealed', '/(\(hi\))/i' => 'hi', '/(\(call\))/i' => 'call', '/(\(devil\))/i' => 'devil', '/(\(angel\))/i' => 'angel', '/(\(envy\))/i' => 'envy', '/(\(wait\))/i' => 'wait', '/(\(bear\))|(\(hug\))/i' => 'bear', '/(\(makeup\))|(\(kate\))/i' => 'makeup', '/(\(giggle\))|(\(chuckle\))/i' => 'coveredlaugh', '/(\(clap\))|(\(applaud\))|(\(applause\))/i' => 'clapping', '/(\(think\))|(\:\?)|(\:\-\?)|(\:\=\?)/i' => 'thinking', '/(\(bow\))/i' => 'bow', '/(rofl)|(\(rofl\))/i' => 'rofl', '/(\(whew\))|(\(phew\))/i' => 'whew', '/(\(happy\))/i' => 'happy', '/(\(smirk\))/i' => 'smirking', '/(\(nod\))/i' => 'nodding', '/(\(shake\))/i' => 'shaking', '/(\(punch\))/i' => 'punch', '/(\(emo\))/i' => 'emo', '/(\(y\))|(\(ok\))/i' => 'yes', '/(\(n\))/i' => 'no', '/(\(handshake\))/i' => 'handshake', '/(\(skype\))|(\(ss\))/i' => 'skype', '/(\(h\))|(\(l\))/i' => 'heart', '/(\(u\))/i' => 'brokenheart', '/(\(e\))|(\(m\))/i' => 'mail', '/(\(f\))/i' => 'flower', '/(\(rain\))|(\(london\))|(\(st\))/i' => 'rain', '/(\(sun\))/i' => 'sun', '/(\(o\))|(\(time\))|(\(clock\))/i' => 'clock', '/(\(8\))|(\(music\))/i' => 'music', '/(\(\~\))|(\(film\))|(\(movie\))/i' => 'movie', '/(\(mp\))|(\(ph\))|(\(phone\))|(\(mobile\))|(\(cell\))/i' => 'phone', '/(\(coffee\))/i' => 'coffee', '/(\(pizza\))|(\(pi\))|(\(za\))/i' => 'pizza', '/(\(cash\))|(\(mo\))|(\(\$\))/i' => 'cash', '/(\(muscle\))|(\(flex\))/i' => 'muscle', '/(\(\^\))|(\(cake\))/i' => 'cake', '/(\(beer\))/i' => 'beer', '/(\(d\))/i' => 'drink', '/(\(dance\))|(\\\o\/)|(\\\:D\/)/i' => 'dance', '/(\(ninja\))/i' => 'ninja', '/(\(\*\))|(\(star\))/i' => 'star', '/(\(mooning\))/i' => 'mooning', '/(\(finger\))/i' => 'finger', '/(\(smoking\))|(\(smoke\))|(\(ci\))|(\(cig\))/i' => 'smoking', '/(\(drunk\))/i' => 'drunk', '/(\(bandit\))/i' => 'bandit', '/(\(toivo\))/i' => 'toivo', '/(\(rock\))/i' => 'rock', '/(\(headbang\))|(\(banghead\))/i' => 'headbang', '/(\(bug\))/i' => 'bug', '/(\(fubar\))/i' => 'fubar', '/(\(poolparty\))/i' => 'poolparty', '/(\(swear\))/i' => 'swear', '/(\(tmi\))/i' => 'tmi', '/(\(heidy\))/i' => 'heidy', '/(\(malthe\))/i' => 'malthe', '/(\(tauri\))/i' => 'tauri', '/(\(priidu\))/i' => 'priidu' ); foreach($emotes as $command => $image) $source = preg_replace($command, '[emote]images/smilies/skype/'.$image.'.gif[/emote]', $source); return $source; } function show_emoticons() { $emotes = array( ':)' => 'smile', ':(' => 'sadsmile', ':D' => 'bigsmile', '8)' => 'cool', ':O' => 'wink', ';(' => 'crying', '(sweat)' => 'sweating', ':|' => 'speechless', ':*' => 'kiss', ':P' => 'tongueout', ':$' => 'blush', ':^' => 'wondering', '|-\\' => 'sleepy', '|(' => 'dull', '(inlove)' => 'inlove', '>:)' => 'evilgrin', '(talk)' => 'talking', '(yawn)' => 'yawn', ':&' => 'puke', '(doh)' => 'doh', ':@' => 'angry', '(wasntme)' => 'wasntme', '(party)' => 'party', ':S' => 'worried', '(mmm)' => 'mmm', '8-|' => 'nerd', ':X' => 'lipssealed', '(hi)' => 'hi', '(call)' => 'call', '(devil)' => 'devil', '(angel))' => 'angel', '(envy)' => 'envy', '(wait)' => 'wait', '(bear)' => 'bear', '(makeup)' => 'makeup', '(giggle)' => 'coveredlaugh', '(clap)' => 'clapping', ':?' => 'thinking', '(bow)' => 'bow', '(rofl)' => 'rofl', '(phew)' => 'whew', '(happy)' => 'happy', '(smirk)' => 'smirking', '(nod)' => 'nodding', '(shake)' => 'shaking', '(punch)' => 'punch', '(emo)' => 'emo', '(y)' => 'yes', '(n)' => 'no', '(handshake)' => 'handshake', '(skype)' => 'skype', '(h)' => 'heart', '(u)' => 'brokenheart', '(e)' => 'mail', '(f)' => 'flower', '(rain)' => 'rain', '(sun)' => 'sun', '(clock)' => 'clock', '(8)' => 'music', '(movie)' => 'movie', '(phone)' => 'phone', '(coffee)' => 'coffee', '(pizza)' => 'pizza', '(cash)' => 'cash', '(muscle)' => 'muscle', '(cake)' => 'cake', '(beer)' => 'beer', '(d)' => 'drink', '(dance)' => 'dance', '(ninja)' => 'ninja', '(*)' => 'star', '(mooning)' => 'mooning', '(finger)' => 'finger', '(smoking)' => 'smoking', '(drunk)' => 'drunk', '(bandit)' => 'bandit', '(toivo)' => 'toivo', '(rock)' => 'rock', '(headbang)' => 'headbang', '(bug)' => 'bug', '(fubar)' => 'fubar', '(poolparty)' => 'poolparty', '(swear)' => 'swear', '(tmi)' => 'tmi', '(heidy)' => 'heidy', '(malthe)' => 'malthe', '(tauri)' => 'tauri', '(priidu)' => 'priidu' ); $html = '<a href="#" name="emotes" id="showhide">Toggle Emotes</a><br /><div class="emoticon-list" id="emotes" style="display:none;">'; foreach($emoticons as $short_code => $short_html) $html .= '<img src="images/smilies/skype/' . $short_html . '.gif" data-short-code="' . $short_code . '" />&nbsp;'; $html .= '</div><br /><a href="bbcode.php">Chat Commands</a>'; $js1 = "<script language=\"JavaScript\" type=\"text/javascript\"> <!-- function insertTextAtCursor(el, text) { var val = el.value, endIndex, range, doc = el.ownerDocument; if (typeof el.selectionStart == 'number' && typeof el.selectionEnd == 'number') { endIndex = el.selectionEnd; el.value = val.slice(0, endIndex) + text + val.slice(endIndex); el.selectionStart = el.selectionEnd = endIndex + text.length; } else if (doc.selection != 'undefined' && doc.selection.createRange) { el.focus(); range = doc.selection.createRange(); range.collapse(false); range.text = text; range.select(); } } //--> </script>"; $js2 = "<script type=\"text/javascript\" src=\"http://code.jquery.com/jquery-1.8.3.min.js\"></script>"; $js3 = "<script type=\"text/javascript\"> jQuery(document).ready(function() { jQuery('div.emoticon-list img').click(function() { var jThis = jQuery(this), jMessage = jQuery('input#message'); jMessage.val(jMessage.val() + ' ' + jThis.attr('data-short-code')); }); }); </script>"; $js4 = "<script> var iframeWin = document.getElementById('message').contentWindow; var textObj = iframeWin.document.getElementById('message'); insertTextAtCursor(textObj, jThis.attr('data-short-code')); </script>"; $js5 = "<script> $(document).ready(function(){ $('#showhide').click(function(){ $('#emotes').toggle('slow'); }); }); </script>"; $css = '<style type="text/css"> div.emoticon-list { padding: 5px; border: none; } div.emoticon-list img { cursor: pointer; margin-right: 3px; border: none; width: 20px; height: 20px; } div.emoticon-list img:hover { border: 1px solid #003F87; } </style>'; echo $js5, $html, $css, $js1, $js2, $js3, $js4; } ?> <?php $complete = 1; ?> <?php echo emote(":)");

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)
8.3.60.0100.00717.00
8.3.50.0080.01723.20
8.3.40.0130.00319.03
8.3.30.0130.00319.31
8.3.20.0060.00320.32
8.3.10.0030.00623.57
8.3.00.0000.00919.50
8.2.180.0130.00716.97
8.2.170.0070.01322.96
8.2.160.0100.00620.45
8.2.150.0090.00024.18
8.2.140.0000.00924.66
8.2.130.0100.00726.16
8.2.120.0090.00021.25
8.2.110.0070.00420.72
8.2.100.0080.00818.22
8.2.90.0000.00919.42
8.2.80.0060.00317.99
8.2.70.0030.00718.00
8.2.60.0040.00418.05
8.2.50.0000.00918.25
8.2.40.0030.00618.34
8.2.30.0040.00419.73
8.2.20.0000.00918.12
8.2.10.0040.00418.29
8.2.00.0030.00618.21
8.1.280.0120.00325.92
8.1.270.0030.00624.09
8.1.260.0080.00026.35
8.1.250.0130.00628.09
8.1.240.0060.00622.43
8.1.230.0040.00924.06
8.1.220.0040.00417.93
8.1.210.0000.00918.77
8.1.200.0070.00317.63
8.1.190.0030.00617.60
8.1.180.0030.00618.10
8.1.170.0030.00618.74
8.1.160.0030.00622.10
8.1.150.0060.00619.11
8.1.140.0030.00617.68
8.1.130.0040.00417.97
8.1.120.0040.00417.82
8.1.110.0080.00017.82
8.1.100.0050.00317.77
8.1.90.0040.00417.82
8.1.80.0000.00817.84
8.1.70.0030.00517.76
8.1.60.0030.00617.98
8.1.50.0060.00317.83
8.1.40.0030.00617.84
8.1.30.0030.00717.96
8.1.20.0030.00617.83
8.1.10.0030.00617.83
8.1.00.0000.00917.81
8.0.300.0060.00318.77
8.0.290.0030.00617.13
8.0.280.0060.00318.61
8.0.270.0030.00617.37
8.0.260.0040.00418.62
8.0.250.0080.00017.18
8.0.240.0050.00317.33
8.0.230.0060.00317.36
8.0.220.0070.00417.23
8.0.210.0050.00317.25
8.0.200.0070.00017.21
8.0.190.0000.00917.24
8.0.180.0040.00417.17
8.0.170.0030.00717.28
8.0.160.0000.00817.29
8.0.150.0040.00417.26
8.0.140.0060.00317.20
8.0.130.0000.00913.65
8.0.120.0000.00917.09
8.0.110.0080.00017.24
8.0.100.0040.00417.13
8.0.90.0030.00617.25
8.0.80.0110.00717.12
8.0.70.0060.00317.07
8.0.60.0030.00617.28
8.0.50.0040.00417.27
8.0.30.0130.01017.45
8.0.20.0080.01317.68
8.0.10.0000.00917.48
8.0.00.0060.01317.21
7.4.330.0030.00315.12
7.4.320.0000.00716.98
7.4.300.0030.00516.71
7.4.290.0050.00316.85
7.4.280.0040.00716.85
7.4.270.0030.00616.88
7.4.260.0000.00816.99
7.4.250.0050.00516.77
7.4.240.0040.00416.89
7.4.230.0000.00816.77
7.4.220.0130.00916.92
7.4.210.0100.00616.94
7.4.200.0090.00016.70
7.4.160.0090.00916.96
7.4.150.0120.00917.40
7.4.140.0080.01017.86
7.4.130.0110.01216.82
7.4.120.0090.01216.89
7.4.110.0000.02016.76
7.4.100.0100.01116.89
7.4.90.0150.00616.84
7.4.80.0130.01219.39
7.4.70.0140.00716.84
7.4.60.0100.01016.91
7.4.50.0090.00016.63
7.4.40.0090.00916.95
7.4.30.0030.01316.83
7.4.00.0090.00915.23
7.3.330.0030.00313.48
7.3.320.0090.00013.55
7.3.310.0040.00416.52
7.3.300.0040.00416.59
7.3.290.0100.00716.69
7.3.280.0090.01116.63
7.3.270.0160.00717.40
7.3.260.0090.01016.73
7.3.250.0060.01416.87
7.3.240.0150.00616.89
7.3.230.0100.01416.94
7.3.210.0170.01016.71
7.3.200.0070.01316.93
7.3.190.0130.00716.91
7.3.180.0110.00716.71
7.3.170.0120.00916.92
7.3.160.0090.01016.91
7.3.10.0120.00317.06
7.3.00.0100.00316.80
7.2.330.0070.01317.02
7.2.320.0030.02017.29
7.2.310.0130.01317.07
7.2.300.0130.01017.07
7.2.290.0160.01317.10
7.2.130.0000.01517.39
7.2.120.0100.00717.28
7.2.110.0040.01117.43
7.2.100.0030.01017.12
7.2.90.0000.01417.41
7.2.80.0000.01517.44
7.2.70.0000.01017.41
7.2.60.0000.01617.45
7.2.50.0070.01017.39
7.2.40.0080.00417.25
7.2.30.0060.00617.41
7.2.20.0100.01017.29
7.2.10.0060.01317.24
7.2.00.0080.00518.59
7.1.250.0030.01016.25
7.1.100.0220.00717.95
7.1.70.0030.00617.23
7.1.60.0100.01719.46
7.1.50.0140.01417.49
7.1.00.0070.07722.71
7.0.200.0220.00717.05
7.0.140.0030.07722.27
7.0.60.0200.07019.98
7.0.50.0000.06318.12
7.0.40.0100.08320.18
7.0.30.0330.03320.24
7.0.20.0100.04720.28
7.0.10.0100.09020.34
7.0.00.0070.08720.32
5.6.280.0030.07720.85
5.6.210.0100.06020.55
5.6.200.0100.08318.33
5.6.190.0100.04720.60
5.6.180.0500.07020.63
5.6.170.0370.05720.55
5.6.160.0070.06320.60
5.6.150.0030.05318.23
5.6.140.0030.08318.32
5.6.130.0070.07018.31
5.6.120.0130.05321.01
5.6.110.0070.09321.06
5.6.100.0170.06321.22
5.6.90.0030.04321.03
5.6.80.0030.08320.51
5.5.350.0170.03720.55
5.5.340.0130.08018.14
5.5.330.0100.04020.50
5.5.320.0330.08020.35
5.5.310.0200.06320.23
5.5.300.0130.06718.12
5.5.290.0070.04017.96
5.5.280.0130.07720.96
5.5.270.0000.06021.02
5.5.260.0000.04320.96
5.5.250.0100.06320.58
5.5.240.0230.07020.24
5.4.450.0100.04719.35
5.4.440.0270.04319.55
5.4.430.0300.04719.22
5.4.420.0300.04719.59
5.4.410.1070.05319.31
5.4.400.0070.04019.27
5.4.390.0470.04319.11
5.4.380.0430.05718.59
5.4.370.0270.06018.85
5.4.360.0270.05318.78
5.4.350.0500.06718.86
5.4.340.0330.07718.77
5.4.320.0080.03812.61
5.4.310.0080.04012.60
5.4.300.0100.03512.60
5.4.290.0100.05012.60
5.4.280.0060.03712.50
5.4.270.0070.03612.49
5.4.260.0060.03812.49
5.4.250.0070.03712.50
5.4.240.0090.04412.49
5.4.230.0060.03712.49
5.4.220.0090.03512.48
5.4.210.0060.03712.49
5.4.200.0060.04312.49
5.4.190.0060.04712.48
5.4.180.0120.04312.48
5.4.170.0050.04412.50
5.4.160.0070.03512.49
5.4.150.0080.04112.48
5.4.140.0060.03812.18
5.4.130.0070.04012.16
5.4.120.0100.04112.12
5.4.110.0090.03212.11
5.4.100.0060.03712.11
5.4.90.0060.03912.11
5.4.80.0090.03612.11
5.4.70.0080.04112.11
5.4.60.0040.03712.11
5.4.50.0080.04012.11
5.4.40.0130.04012.10
5.4.30.0060.04112.10
5.4.20.0070.03712.10
5.4.10.0050.03712.10
5.4.00.0090.03311.58
5.3.290.0100.04012.83
5.3.280.0070.04312.76
5.3.270.0100.04412.77
5.3.260.0140.03512.77
5.3.250.0150.03712.78
5.3.240.0080.03812.77
5.3.230.0090.04312.76
5.3.220.0120.04312.73
5.3.210.0090.04112.73
5.3.200.0080.04212.73
5.3.190.0110.04312.73
5.3.180.0100.04412.73
5.3.170.0080.04112.73
5.3.160.0110.04312.73
5.3.150.0140.04512.73
5.3.140.0050.03812.72
5.3.130.0040.04012.71
5.3.120.0070.03812.71
5.3.110.0050.04312.71
5.3.100.0110.03612.20
5.3.90.0050.04412.19
5.3.80.0070.04212.18
5.3.70.0090.03512.18
5.3.60.0060.04212.16
5.3.50.0070.04412.11
5.3.40.0120.03612.11
5.3.30.0070.04212.07
5.3.20.0080.04211.85
5.3.10.0050.04011.81
5.3.00.0130.03811.80
5.2.170.0100.0309.30
5.2.160.0080.0349.30
5.2.150.0040.0419.30
5.2.140.0060.0369.30
5.2.130.0080.0289.26
5.2.120.0040.0379.26
5.2.110.0050.0379.27
5.2.100.0080.0299.26
5.2.90.0060.0339.26
5.2.80.0120.0279.25
5.2.70.0080.0309.25
5.2.60.0050.0399.20
5.2.50.0060.0359.18
5.2.40.0060.0319.15
5.2.30.0030.0329.13
5.2.20.0060.0289.13
5.2.10.0070.0279.02
5.2.00.0050.0358.88
5.1.60.0040.0278.18
5.1.50.0080.0248.17
5.1.40.0050.0268.15
5.1.30.0070.0298.50
5.1.20.0050.0268.53
5.1.10.0060.0248.25
5.1.00.0040.0268.25
5.0.50.0060.0256.73
5.0.40.0020.0216.59
5.0.30.0020.0326.40
5.0.20.0020.0206.37
5.0.10.0040.0256.34
5.0.00.0030.0346.34
4.4.90.0040.0194.78
4.4.80.0040.0184.75
4.4.70.0060.0224.75
4.4.60.0030.0214.75
4.4.50.0030.0194.77
4.4.40.0040.0284.73
4.4.30.0030.0194.76
4.4.20.0010.0274.85
4.4.10.0040.0194.84
4.4.00.0030.0274.76
4.3.110.0070.0194.66
4.3.100.0030.0194.66
4.3.90.0050.0124.63
4.3.80.0030.0304.63
4.3.70.0050.0164.63
4.3.60.0030.0184.63
4.3.50.0020.0164.63
4.3.40.0030.0264.58
4.3.30.0030.0233.39
4.3.20.0040.0263.37
4.3.10.0030.0143.32
4.3.00.0030.01018.56

preferences:
39.64 ms | 401 KiB | 5 Q