3v4l.org

run code in 300+ PHP versions simultaneously
<?php $message = "This is a string using the terms? Wait here's one\n abukuma kai\nabukuma-kai\nabukuma\nabukuma\nkai abukuma abukuma kai"; $search = array( 'abukuma kai', 'abukuma' ); $replacements = array( // here all replaces | each in a new line - watch the syntax // all html possible, but no single quotation mark! '<a href="http://kancolle.wikia.com/wiki/Abukuma#Upgrade" class="screenshot" rel="ship/Abukuma_Kai.png" style="color:#0073e6; font-weight:bold; border-bottom: 1px #0073e6 dashed;"><p id="yosup">Abukuma Kai</p></a>', '<a href="http://kancolle.wikia.com/wiki/Abukuma#Basic" class="screenshot" rel="ship/Abukuma.png" style="color:#0073e6; font-weight:bold; border-bottom: 1px #0073e6 dashed;">Abukuma</a>' ); function replaceStrings($haystack, $needle, $replacement, $offset = 0) { if (is_array($needle)) { $massagedNeedles = array_map( function($s) { $s = preg_quote($s, '/'); $s = return $s; }, $needle ); $regexp = implode('|', $massagedNeedes); } else { $regexp = str_replace(' ', '[-\s_]', preg_quote($needle, '/')); } $regexp = sprintf('/%s/i', $regexp); $strpos = preg_match($regexp, $haystack, $matches, 0, $offset); if ($strpos === false) { return $haystack; } var_dump($matches); exit; return replaceStrings($haystack, $needle, $replacement, $offset); }

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.240.0240.06012.41
5.4.230.0130.03912.40
5.4.220.0110.04112.40
5.4.210.0080.04212.40
5.4.200.0100.04212.40
5.4.190.0100.04012.40
5.4.180.0120.03812.40
5.4.170.0100.04112.40
5.4.160.0100.04112.40
5.4.150.0090.04312.39
5.4.140.0200.06112.08
5.4.130.0100.04212.06
5.4.120.0130.03912.03
5.4.110.0150.03512.03
5.4.100.0120.04312.02
5.4.90.0120.04412.02
5.4.80.0120.03912.02
5.4.70.0120.03712.02
5.4.60.0110.03812.02
5.4.50.0100.04612.02
5.4.40.0090.04012.01
5.4.30.0150.05412.00
5.4.20.0120.03812.00
5.4.10.0110.03812.00
5.4.00.0120.03911.50
5.3.280.0110.04612.71
5.3.270.0110.04112.72
5.3.260.0160.05312.72
5.3.250.0130.03912.72
5.3.240.0130.03912.72
5.3.230.0120.04212.71
5.3.220.0140.03812.68
5.3.210.0120.04112.68
5.3.200.0190.04812.68
5.3.190.0130.04212.67
5.3.180.0130.03912.67
5.3.170.0110.04112.67
5.3.160.0100.04212.67
5.3.150.0180.05412.67
5.3.140.0120.04612.66
5.3.130.0110.04212.66
5.3.120.0120.04012.65
5.3.110.0090.04412.66
5.3.100.0110.04012.12
5.3.90.0110.03912.10
5.3.80.0130.03812.09
5.3.70.0100.04112.09
5.3.60.0110.04012.07
5.3.50.0110.03912.02
5.3.40.0110.03912.02
5.3.30.0120.03711.98
5.3.20.0100.04011.76
5.3.10.0140.03611.72
5.3.00.0100.04311.71

preferences:
131.2 ms | 1394 KiB | 7 Q