3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '<p> The <b>Sarcopterygii</b> or <b>lobe-finned fish</b> (from Greek σαρξ <i>sarx</i>, flesh, and πτερυξ <i>pteryx</i>, fin) – sometimes considered synonymous with <b>Crossopterygii</b> ("fringe-finned fish", from Greek κροσσός <i>krossos</i>, fringe) – constitute a <a href="/wiki/Clade" title="Clade">clade</a> (traditionally a <a href="/wiki/Class_(biology)" title="Class (biology)">class</a> or subclass) of the <a href="/wiki/Osteichthyes" title="Osteichthyes">bony fish</a>, though a strict <a href="/wiki/Cladistic" class="mw-redirect" title="Cladistic">cladistic</a> view includes the terrestrial <a href="/wiki/Vertebrate" title="Vertebrate">vertebrates</a>. </p>'; $occurrences = 0; $replacements = []; $replacedString = preg_replace_callback("/<a .*?>.*?<\/a>/i", function($el) use (&$occurrences, &$replacements) { $replacements["|||".$occurrences] = $el[0]; // the ||| are just to avoid unwanted matches return "|||".$occurrences++; }, $string); function removeParentheses( $content ) { $pattern = '@\(.*?\)@'; $content = preg_replace( $pattern, '', $content ); $content = str_replace( ' .', '.', $content ); $content = str_replace( ' ', ' ', $content ); return $content; } $replacedString = removeParentheses($replacedString); $replacedString = str_replace(array_keys($replacements), array_values($replacements), $replacedString); echo $replacedString;

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.4.120.0130.00822.29
8.4.110.0130.00622.54
8.4.100.0100.00619.07
8.4.90.0080.00520.57
8.4.80.0080.01318.96
8.4.70.0030.00518.89
8.4.60.0050.01118.87
8.4.50.0140.00718.27
8.4.40.0120.00917.70
8.4.30.0130.00617.99
8.4.20.0130.00719.46
8.4.10.0030.00619.68
8.3.250.0080.01020.86
8.3.240.0100.00916.81
8.3.230.0100.00616.59
8.3.220.0060.01219.10
8.3.210.0110.00316.80
8.3.200.0040.00516.70
8.3.190.0050.00318.92
8.3.180.0120.00716.98
8.3.170.0160.00316.67
8.3.160.0130.00319.07
8.3.150.0130.00616.98
8.3.140.0000.00817.46
8.3.130.0060.00318.49
8.3.120.0080.00019.18
8.3.110.0100.01020.94
8.3.100.0130.00716.58
8.3.90.0090.00926.77
8.3.80.0040.00717.97
8.3.70.0080.00818.43
8.3.60.0070.01117.00
8.3.50.0260.00817.52
8.3.40.0120.00919.13
8.3.30.0120.00319.10
8.3.20.0040.00420.13
8.3.10.0060.00321.88
8.3.00.0090.00623.36
8.2.290.0120.00620.40
8.2.280.0090.01020.77
8.2.270.0110.00716.96
8.2.260.0110.00718.92
8.2.250.0040.00418.55
8.2.240.0000.00819.30
8.2.230.0040.00722.58
8.2.220.0060.00324.06
8.2.210.0030.00526.77
8.2.200.0090.00016.75
8.2.190.0130.01016.75
8.2.180.0120.00616.75
8.2.170.0090.00622.96
8.2.160.0030.01020.39
8.2.150.0050.00325.66
8.2.140.0050.00324.66
8.2.130.0080.00026.16
8.2.120.0070.00419.91
8.2.110.0030.00720.52
8.2.100.0080.00418.03
8.2.90.0000.00817.96
8.2.80.0030.00618.05
8.2.70.0050.00518.03
8.2.60.0060.00318.21
8.2.50.0080.00018.10
8.2.40.0080.00020.47
8.2.30.0040.00419.47
8.2.20.0000.00718.09
8.2.10.0040.00418.23
8.2.00.0040.00418.20
8.1.330.0090.00921.88
8.1.320.0120.00618.07
8.1.310.0080.00017.05
8.1.300.0030.00620.32
8.1.290.0060.00330.84
8.1.280.0090.00625.92
8.1.270.0040.00824.66
8.1.260.0070.00026.35
8.1.250.0060.00328.09
8.1.240.0090.01222.13
8.1.230.0060.00622.27
8.1.220.0040.00417.88
8.1.210.0040.00418.77
8.1.200.0060.00317.60
8.1.190.0030.00617.61
8.1.180.0000.00818.10
8.1.170.0040.00418.97
8.1.160.0000.00718.95
8.1.150.0050.00220.21
8.1.140.0040.00417.64
8.1.130.0070.00019.04
8.1.120.0070.00017.68
8.1.110.0050.00317.60
8.1.100.0050.00217.55
8.1.90.0000.00717.67
8.1.80.0000.00717.53
8.1.70.0070.00017.54
8.1.60.0000.00917.75
8.1.50.0040.00417.70
8.1.40.0060.00317.71
8.1.30.0030.00517.86
8.1.20.0040.00417.78
8.1.10.0040.00417.77
8.1.00.0030.00617.70
8.0.300.0000.00820.05
8.0.290.0000.00816.88
8.0.280.0030.00618.41
8.0.270.0000.00717.20
8.0.260.0070.00018.64
8.0.250.0030.00317.08
8.0.240.0080.00017.19
8.0.230.0030.00517.11
8.0.220.0030.00317.01
8.0.210.0040.00417.09
8.0.200.0050.00217.01
8.0.190.0030.00617.02
8.0.180.0050.00216.99
8.0.170.0040.00417.07
8.0.160.0030.00517.16
8.0.150.0000.00716.92
8.0.140.0000.00817.05
8.0.130.0000.00913.48
8.0.120.0000.00716.95
8.0.110.0040.00417.01
8.0.100.0040.00416.90
8.0.90.0040.00416.89
8.0.80.0030.01316.97
8.0.70.0040.00417.07
8.0.60.0030.00517.07
8.0.50.0050.00316.95
8.0.30.0140.00617.36
8.0.20.0130.00617.41
8.0.10.0040.00417.14
8.0.00.0130.00617.00
7.4.330.0000.00515.55
7.4.320.0000.00616.74
7.4.300.0030.00316.71
7.4.290.0040.00416.83
7.4.280.0000.00716.76
7.4.270.0030.00316.71
7.4.260.0070.00016.64
7.4.250.0030.00316.83
7.4.240.0000.00716.90
7.4.230.0040.00416.75
7.4.220.0170.00316.71
7.4.210.0090.00616.78
7.4.200.0050.00316.77
7.4.160.0080.00816.81
7.4.150.0210.00017.40
7.4.140.0060.01217.86
7.4.130.0090.01516.59
7.4.120.0050.01416.64
7.4.110.0060.01216.53
7.4.100.0130.00316.77
7.4.90.0160.00616.70
7.4.80.0060.01619.39
7.4.70.0040.01316.80
7.4.60.0160.00016.58
7.4.50.0040.01116.51
7.4.40.0070.01016.65
7.4.30.0090.00916.64
7.4.00.0060.01015.00
7.3.330.0030.00313.47
7.3.320.0000.00513.59
7.3.310.0000.00716.45
7.3.300.0060.00316.52
7.3.290.0050.01116.59
7.3.280.0100.00916.52
7.3.270.0110.00717.40
7.3.260.0150.00616.67
7.3.250.0090.00916.72
7.3.240.0110.01016.70
7.3.230.0100.01016.61
7.3.210.0120.00916.61
7.3.200.0090.00916.66
7.3.190.0000.01616.78
7.3.180.0030.01616.50
7.3.170.0070.01016.77
7.3.160.0060.01016.84
7.2.330.0030.01416.70
7.2.320.0090.00916.92
7.2.310.0100.01416.95
7.2.300.0040.01516.95
7.2.290.0180.00016.83
7.2.60.0000.01317.13
7.1.200.0030.01015.84
7.1.100.0090.01216.54
7.1.90.2180.01016.43
7.1.80.5310.01416.47
7.1.70.4600.01015.61
7.1.60.3940.01633.18
7.1.50.4630.02332.74
7.1.40.3680.01632.48
7.1.30.3520.00632.54
7.1.20.2510.01032.66
7.1.10.2320.00014.93
7.1.00.2300.00715.07
7.0.240.3950.01115.95
7.0.230.0110.00916.18
7.0.220.0410.00816.41
7.0.210.4880.00715.02
7.0.200.5860.01015.06
7.0.190.5720.01215.18
7.0.180.3700.01314.46
7.0.170.2480.01214.49
7.0.160.2730.01014.63
7.0.150.3110.01014.60
7.0.140.3070.00714.93
7.0.130.2960.01315.00
7.0.120.2150.00315.13
7.0.110.2610.01014.76
7.0.100.3740.01014.67
7.0.90.2480.01314.70
7.0.80.1890.01014.87
7.0.70.1910.00714.78
7.0.60.1790.01314.51
7.0.50.2810.00914.65
7.0.40.2980.01515.09
7.0.30.2690.01314.68
7.0.20.2020.00714.86
7.0.10.2560.00614.76
7.0.00.2880.01014.79

preferences:
122.58 ms | 403 KiB | 5 Q