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;
Output for git.master, git.master_jit, rfc.property-hooks
<p> The <b>Sarcopterygii</b> or <b>lobe-finned fish</b> – sometimes considered synonymous with <b>Crossopterygii</b> – constitute a <a href="/wiki/Clade" title="Clade">clade</a> 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>

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
134.32 ms | 406 KiB | 5 Q