3v4l.org

run code in 300+ PHP versions simultaneously
<?php $search = array( '/&#36;/', "/\r/", // Non-legal carriage return "/[\n\t]+/", // Newlines and tabs '/[ ]{2,}/', // Runs of spaces, pre-handling '/<script[^>]*>.*?<\/script>/i', // <script>s -- which strip_tags supposedly has problems with '/<style[^>]*>.*?<\/style>/i', // <style>s -- which strip_tags supposedly has problems with //'/<!-- .* -->/', // Comments -- which strip_tags might have problem a with '/<h[123][^>]*>(.*?)<\/h[123]>/i', // H1 - H3 '/<h[456][^>]*>(.*?)<\/h[456]>/ie', // H4 - H6 '/<p[^>]*>/i', // <P> '/<br[^>]*>/i', // <br> '/<b[^>]*>(.*?)<\/b>/i', // <b> '/<strong[^>]*>(.*?)<\/strong>/i', // <strong> '/<i[^>]*>(.*?)<\/i>/i', // <i> '/<em[^>]*>(.*?)<\/em>/i', // <em> '/(<ul[^>]*>|<\/ul>)/i', // <ul> and </ul> '/(<ol[^>]*>|<\/ol>)/i', // <ol> and </ol> '/<li[^>]*>(.*?)<\/li>/i', // <li> and </li> '/<li[^>]*>/i', // <li> // '/<a [^>]*href="(.*?)([^"]+)"[^>]*><\/a>/ie', // '/<a [^>]*href="([^"]+)"[^>]*>(.*?)<\/a>/ie', // <a href=""> '/<hr[^>]*>/i', // <hr> '/(<table[^>]*>|<\/table>)/i', // <table> and </table> '/(<tr[^>]*>|<\/tr>)/i', // <tr> and </tr> '/<td[^>]*>(.*?)<\/td>/i', // <td> and </td> '/<th[^>]*>(.*?)<\/th>/i', // <th> and </th> '/&(nbsp|#160);/i', // Non-breaking space '/&(quot|rdquo|ldquo|#8220|#8221|#147|#148);/i', // Double quotes '/&(apos|rsquo|lsquo|#8216|#8217);/i', // Single quotes '/&gt;/i', // Greater-than '/&lt;/i', // Less-than '/&(amp|#38);/i', // Ampersand '/&(copy|#169);/i', // Copyright '/&(trade|#8482|#153);/i', // Trademark '/&(reg|#174);/i', // Registered '/&(mdash|#151|#8212);/i', // mdash '/&(ndash|minus|#8211|#8722);/i', // ndash '/&(bull|#149|#8226);/i', // Bullet '/&(pound|#163);/i', // Pound sign '/&(euro|#8364);/i', // Euro sign //'/&[^&;]+;/i', // Unknown/unhandled entities '/&[a-z0-9#]{1,10};/i', // Unknown/unhandled entities '/[ ]{2,}/' // Runs of spaces, post-handling ); /** * List of pattern replacements corresponding to patterns searched. * * @var array $replace * @access public * @see $search */ $replace = array( '$', '', // Non-legal carriage return ' ', // Newlines and tabs ' ', // Runs of spaces, pre-handling '', // <script>s -- which strip_tags supposedly has problems with '', // <style>s -- which strip_tags supposedly has problems with //'', // Comments -- which strip_tags might have problem a with "\n\n\\1\n\n", // H1 - H3 "ucwords(\"\n\n\\1\n\n\")", // H4 - H6 "\n\n\t", // <P> "\n", // <br> "\\1", // <b> "\\1", // <strong> '_\\1_', // <i> '_\\1_', // <em> "\n\n", // <ul> and </ul> "\n\n", // <ol> and </ol> "\t* \\1\n", // <li> and </li> "\n\t* ", // <li> // '$this->_build_link_list("\\1", "\\2")', // <a href=""> "\n-------------------------\n", // <hr> "\n\n", // <table> and </table> "\n", // <tr> and </tr> "\t\t\\1\n", // <td> and </td> "\t\t\\1\n", // <th> and </th> ' ', // Non-breaking space '"', // Double quotes "'", // Single quotes '>', '<', '&', '(c)', '(tm)', '(R)', '--', '-', '*', '▒', 'EUR', // Euro sign. . ? '', // Unknown/unhandled entities ' ' // Runs of spaces, post-handling ); $data = <<<EOT <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>email</title> </head> <body style="margin: 0;padding: 0;background: #f9f9f9;font-size: 14px;color: #5b656e;"> <!-- Preheader --> <table cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;background-color: #5b656e;"> <tr> <td style="font-family: tahoma, geneva, sans-serif;color: #313a42;border-collapse: collapse;"> <table border="0" cellpadding="0" cellspacing="0" summary="" width="640" align="center" style="border-collapse: collapse;"> <tr> <td style="font-family: tahoma, geneva, sans-serif;color: white;border-collapse: collapse;font-size: 10px;width: 440px;padding: 5px 10px;">Don't want to hear from us anymore? <a href="$unsubscribe$" style="color: #09c;">Unsubscribe here.</a></td> </tr> </table> </td> </tr> </table> EOT; var_dump(preg_replace($search, $replace, $data));

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.0060.00916.63
8.3.50.0070.00922.18
8.3.40.0040.01119.04
8.3.30.0040.01119.17
8.3.20.0070.00020.18
8.3.10.0030.00521.74
8.3.00.0040.00419.63
8.2.180.0040.01116.50
8.2.170.0150.00322.96
8.2.160.0100.00320.48
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0040.00422.31
8.2.110.0060.00322.37
8.2.100.0130.00018.16
8.2.90.0090.00019.14
8.2.80.0000.00817.97
8.2.70.0080.00317.88
8.2.60.0030.00617.80
8.2.50.0030.00618.07
8.2.40.0090.00318.09
8.2.30.0050.00319.88
8.2.20.0080.00018.02
8.2.10.0070.00018.28
8.2.00.0040.00418.12
8.1.280.0060.01525.92
8.1.270.0050.00323.96
8.1.260.0000.00826.35
8.1.250.0050.00328.09
8.1.240.0040.00423.92
8.1.230.0000.01219.22
8.1.220.0030.00617.80
8.1.210.0040.00418.77
8.1.200.0030.00617.50
8.1.190.0040.00417.34
8.1.180.0030.00619.13
8.1.170.0050.00318.69
8.1.160.0040.00422.03
8.1.150.0040.00418.75
8.1.140.0000.00717.49
8.1.130.0030.00317.92
8.1.120.0000.00817.46
8.1.110.0040.00417.59
8.1.100.0050.00217.59
8.1.90.0040.00417.54
8.1.80.0040.00417.46
8.1.70.0000.00817.54
8.1.60.0030.00617.58
8.1.50.0030.00617.59
8.1.40.0030.00517.47
8.1.30.0030.00517.73
8.1.20.0030.00517.75
8.1.10.0060.00317.54
8.1.00.0040.00417.64
8.0.300.0040.00418.77
8.0.290.0060.00317.16
8.0.280.0040.00418.53
8.0.270.0070.00017.16
8.0.260.0000.00617.29
8.0.250.0000.00717.15
8.0.240.0000.00717.16
8.0.230.0040.00417.02
8.0.220.0050.00317.13
8.0.210.0030.00317.08
8.0.200.0070.00017.16
8.0.190.0080.00317.12
8.0.180.0040.00417.02
8.0.170.0030.00517.13
8.0.160.0000.00717.23
8.0.150.0000.00816.95
8.0.140.0000.00816.98
8.0.130.0030.00313.58
8.0.120.0040.00417.05
8.0.110.0000.00717.18
8.0.100.0000.00717.11
8.0.90.0040.00417.03
8.0.80.0090.01217.20
8.0.70.0080.00017.21
8.0.60.0040.00417.20
8.0.50.0060.00317.14
8.0.30.0070.01417.10
8.0.20.0100.00917.40
8.0.10.0020.00517.27
8.0.00.0140.01216.94
7.4.330.0050.00015.04
7.4.320.0030.00316.68
7.4.300.0030.00316.81
7.4.290.0000.00916.73
7.4.280.0030.00316.68
7.4.270.0000.00716.75
7.4.260.0030.00616.73
7.4.250.0000.00816.76
7.4.240.0020.00516.79
7.4.230.0030.00316.85
7.4.220.0110.00716.68
7.4.210.0080.00816.80
7.4.200.0040.00416.93
7.4.190.0030.00316.71
7.4.160.0130.00616.76
7.4.150.0000.01817.40
7.4.140.0130.00517.86
7.4.130.0090.00916.82
7.4.120.0090.00916.60
7.4.110.0110.01116.68
7.4.100.0060.01616.79
7.4.90.0100.00716.75
7.4.80.0100.01319.39
7.4.70.0040.01216.66
7.4.60.0130.00316.63
7.4.50.0000.00816.58
7.4.40.0040.01516.64
7.4.30.0090.00616.77
7.4.00.0090.00915.19
7.3.330.0060.00013.27
7.3.320.0030.00313.16
7.3.310.0040.00416.26
7.3.300.0000.00716.46
7.3.290.0030.01616.41
7.3.280.0080.01116.42
7.3.270.0100.00717.40
7.3.260.0110.00816.46
7.3.250.0180.00216.57
7.3.240.0160.00016.51
7.3.230.0130.00616.60
7.3.210.0100.00716.45
7.3.200.0090.01219.39
7.3.190.0090.00916.66
7.3.180.0000.01616.66
7.3.170.0090.01316.82
7.3.160.0120.00316.75
7.3.120.0120.00514.80
7.3.110.0120.00614.74
7.3.100.0130.00614.76
7.3.90.0030.01015.25
7.3.80.0030.01014.97
7.3.70.0110.00015.10
7.3.60.0070.00715.05
7.3.50.0110.00415.05
7.3.40.0070.01014.94
7.3.30.0060.01014.81
7.3.20.0040.00816.75
7.3.10.0100.00616.70
7.3.00.0040.00916.48
7.2.330.0130.00416.63
7.2.320.0030.01416.60
7.2.310.0040.01516.52
7.2.300.0120.00616.81
7.2.290.0090.00916.60
7.2.250.0030.01715.31
7.2.240.0140.00715.04
7.2.230.0060.01015.17
7.2.220.0000.01715.09
7.2.210.0110.00415.10
7.2.200.0040.01115.05
7.2.190.0070.01015.03
7.2.180.0130.00715.30
7.2.170.0040.01115.15
7.2.160.0120.00014.94
7.2.150.0030.01016.86
7.2.140.0030.01016.85
7.2.130.0050.01016.97
7.2.120.0070.00816.98
7.2.110.0060.00816.79
7.2.100.0090.00517.00
7.2.90.0030.00916.84
7.2.80.0050.00716.79
7.2.70.0000.01117.09
7.2.60.0040.00916.96
7.2.50.0050.00817.06
7.2.40.0080.00817.03
7.2.30.0070.00617.08
7.2.20.0040.00716.94
7.2.10.0060.00716.90
7.2.00.0040.00617.77
7.1.330.0070.01016.05
7.1.320.0080.00816.05
7.1.310.0060.01216.14
7.1.300.0060.01215.96
7.1.290.0060.01015.93
7.1.280.0000.01515.76
7.1.270.0070.00716.01
7.1.260.0090.00615.71
7.1.250.0060.00716.11
7.1.240.0070.00716.04
7.1.230.0030.01415.92
7.1.220.0070.01116.02
7.1.210.0000.01115.82
7.1.200.0110.00015.87
7.1.190.0030.00615.93
7.1.180.0080.00316.01
7.1.170.0060.00615.91
7.1.160.0070.00316.03
7.1.150.0120.00316.00
7.1.140.0030.00815.75
7.1.130.0070.00715.89
7.1.120.0040.00415.86
7.1.110.0040.00716.11
7.1.100.0030.00817.38
7.1.90.0040.01116.13
7.1.80.0030.01016.08
7.1.70.0010.00716.58
7.1.60.0050.01317.66
7.1.50.0050.01216.46
7.1.40.0120.00315.73
7.1.30.0000.01215.75
7.1.20.0040.00815.86
7.1.10.0030.01016.02
7.1.00.0040.04119.16
7.0.330.0040.01015.36
7.0.320.0030.01215.59
7.0.310.0040.00415.49
7.0.300.0060.00315.66
7.0.290.0070.00715.37
7.0.280.0030.01115.74
7.0.270.0040.01115.78
7.0.260.0080.00315.62
7.0.250.0100.00315.59
7.0.240.0090.00615.40
7.0.230.0030.00715.60
7.0.220.0030.00915.78
7.0.210.0030.00915.45
7.0.200.0060.00716.06
7.0.190.0030.01015.75
7.0.180.0030.01015.69
7.0.170.0110.00315.70
7.0.160.0060.00615.54
7.0.150.0040.00715.68
7.0.140.0100.03518.84
7.0.130.0060.00915.54
7.0.120.0040.01215.73
7.0.110.0100.00615.58
7.0.100.0070.00415.67
7.0.90.0000.01015.59
7.0.80.0060.00315.51
7.0.70.0080.00815.54
7.0.60.0040.04817.61
7.0.50.0110.02916.75
7.0.40.0070.02516.77
7.0.30.0200.03816.86
7.0.20.0180.03316.92
7.0.10.0080.04017.03
7.0.00.0070.03916.87
5.6.400.0110.00414.34
5.6.390.0060.00814.43
5.6.380.0090.00014.31
5.6.370.0070.00714.65
5.6.360.0030.00714.60
5.6.350.0150.00014.36
5.6.340.0040.01114.02
5.6.330.0060.00914.66
5.6.320.0040.01114.15
5.6.310.0040.01114.58
5.6.300.0120.00314.44
5.6.290.0100.00314.28
5.6.280.0060.04017.67
5.6.270.0070.00714.31
5.6.260.0050.00514.70
5.6.250.0040.01114.20
5.6.240.0000.00914.27
5.6.230.0060.00914.51
5.6.220.0070.01014.54
5.6.210.0060.03317.41
5.6.200.0070.04116.35
5.6.190.0070.04517.50
5.6.180.0210.04417.46
5.6.170.0120.03517.67
5.6.160.0080.04817.45
5.6.150.0110.03316.14
5.6.140.0050.04516.28
5.6.130.0080.02316.34
5.6.120.0080.02517.70
5.6.110.0110.02017.72
5.6.100.0130.03917.64
5.6.90.0070.03017.62
5.6.80.0070.02917.38
5.6.70.0090.00614.41
5.6.60.0000.00914.38
5.6.50.0060.00314.28
5.6.40.0110.00714.22
5.6.30.0030.00914.20
5.6.20.0030.00714.36
5.6.10.0070.00314.21
5.6.00.0090.00614.30
5.5.380.0060.00614.07
5.5.370.0000.01414.38
5.5.360.0100.00614.45
5.5.350.0190.04017.29
5.5.340.0050.04616.21
5.5.330.0050.03117.09
5.5.320.0050.03517.39
5.5.310.0260.03517.15
5.5.300.0120.04016.14
5.5.290.0070.02516.20
5.5.280.0000.02617.68
5.5.270.0090.03917.47
5.5.260.0070.04217.61
5.5.250.0090.02717.51
5.5.240.0140.01917.11
5.5.230.0100.00614.30
5.5.220.0030.01014.22
5.5.210.0000.01814.27
5.5.200.0090.00914.09
5.5.190.0030.01214.34
5.5.180.0090.00614.33
5.5.170.0030.00714.32
5.5.160.0070.00713.99
5.5.150.0100.00414.46
5.5.140.0060.00614.25
5.5.130.0080.00413.86
5.5.120.0040.01114.15
5.5.110.0070.01114.20
5.5.100.0030.01414.30
5.5.90.0040.00814.39
5.5.80.0060.00914.06
5.5.70.0100.00314.21
5.5.60.0070.00414.31
5.5.50.0080.00314.15
5.5.40.0040.00414.36
5.5.30.0000.01314.27
5.5.20.0040.00414.11
5.5.10.0100.00313.99
5.5.00.0090.00314.02
5.4.450.0080.03315.82
5.4.440.0510.04315.63
5.4.430.0520.03115.81
5.4.420.0470.03415.89
5.4.410.0500.02815.57
5.4.400.0520.02815.56
5.4.390.0300.03215.70
5.4.380.0090.03015.43
5.4.370.0100.02915.36
5.4.360.0060.03315.44
5.4.350.0120.02815.37
5.4.340.0100.02515.44
5.4.330.0060.00612.16
5.4.320.0040.02512.33
5.4.310.0080.02512.33
5.4.300.0030.02712.33
5.4.290.0090.02912.32
5.4.280.0070.02312.28
5.4.270.0050.02512.27
5.4.260.0120.02412.27
5.4.250.0070.02912.27
5.4.240.0070.02812.27
5.4.230.0080.02612.27
5.4.220.0050.03212.27
5.4.210.0040.02412.27
5.4.200.0060.02212.27
5.4.190.0050.02612.27
5.4.180.0050.02812.27
5.4.170.0060.02712.27
5.4.160.0060.02412.27
5.4.150.0070.02312.27
5.4.140.0040.02512.11
5.4.130.0090.02112.11
5.4.120.0070.02212.09
5.4.110.0050.02412.08
5.4.100.0060.02912.08
5.4.90.0080.03412.08
5.4.80.0070.03012.08
5.4.70.0020.02312.08
5.4.60.0090.01812.08
5.4.50.0030.02112.08
5.4.40.0050.02212.07
5.4.30.0040.02412.07
5.4.20.0040.02112.07
5.4.10.0040.02212.07
5.4.00.0070.01911.82
5.3.290.0040.02212.48
5.3.280.0060.02412.43
5.3.270.0040.02912.44
5.3.260.0050.02812.44
5.3.250.0060.02412.44
5.3.240.0080.02412.44
5.3.230.0050.03412.43
5.3.220.0020.03312.42
5.3.210.0060.03712.42
5.3.200.0090.03012.42
5.3.190.0100.02812.42
5.3.180.0100.02412.42
5.3.170.0080.02612.41
5.3.160.0050.03012.42
5.3.150.0080.03012.41
5.3.140.0100.02712.41
5.3.130.0090.03212.41
5.3.120.0070.05712.41
5.3.110.0100.02912.41
5.3.100.0060.03112.14
5.3.90.0090.02012.14
5.3.80.0020.02812.13
5.3.70.0070.02912.13
5.3.60.0040.03112.13
5.3.50.0090.03412.10
5.3.40.0070.03412.10
5.3.30.0050.03212.08
5.3.20.0080.03211.97
5.3.10.0050.02711.95
5.3.00.0040.02211.95
5.2.170.0050.0329.24
5.2.160.0060.0309.24
5.2.150.0040.0359.23
5.2.140.0050.0319.23
5.2.130.0020.0319.19
5.2.120.0030.0339.20
5.2.110.0050.0289.20
5.2.100.0080.0269.20
5.2.90.0080.0379.20
5.2.80.0090.0419.20
5.2.70.0050.0449.20
5.2.60.0090.0409.14
5.2.50.0060.0429.11
5.2.40.0020.0449.09
5.2.30.0100.0369.08
5.2.20.0070.0389.12
5.2.10.0080.0379.02
5.2.00.0100.0418.88
5.1.60.0040.0278.18
5.1.50.0110.0348.17
5.1.40.0080.0238.16
5.1.30.0080.0378.50
5.1.20.0060.0398.52
5.1.10.0070.0348.25
5.1.00.0070.0358.25
5.0.50.0060.0326.73
5.0.40.0060.0356.58
5.0.30.0050.0466.40
5.0.20.0030.0336.37
5.0.10.0020.0536.34
5.0.00.0080.0536.34
4.4.90.0070.0224.78
4.4.80.0050.0234.75
4.4.70.0080.0324.75
4.4.60.0060.0284.75
4.4.50.0050.0204.77
4.4.40.0040.0314.71
4.4.30.0050.0214.76
4.4.20.0040.0254.85
4.4.10.0090.0204.85
4.4.00.0070.0294.76
4.3.110.0030.0224.67
4.3.100.0080.0504.66
4.3.90.0040.0204.64
4.3.80.0160.0514.63
4.3.70.0070.0224.63
4.3.60.0050.0214.63
4.3.50.0060.0164.63
4.3.40.0040.0314.55
4.3.30.0030.0233.35
4.3.20.0010.0233.33
4.3.10.0020.0223.28
4.3.00.0070.02316.04

preferences:
39.96 ms | 401 KiB | 5 Q