3v4l.org

run code in 300+ PHP versions simultaneously
<?php $regex = <<<'REGEX' ~ <strong\s*> # Match strong open tag ( # Open group 1 (?: # Non-capturing group (?:(?!</?strong\s*>).) # Match anything that's not strong tag (open/close) | # Or (?R) # Repeat the whole pattern )* # Repeat the non-capturing group zero or more times ) # Close group 1 </strong\s*> # Match strong close tag ~xs REGEX; # The x modifier is for the fancy spacing en commenting # The s modifier is to match newlines with dot "." $output = preg_replace_callback($regex, function($m){ return '<strong>' . preg_replace('~</?strong\s*>~', '', $m[1]) . '</strong>'; }, $input); echo $output; // w1 <strong>w2</strong> w3 w4 <strong>w5 w6</strong> w7
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $input in /in/D6MPi on line 21 Deprecated: preg_replace_callback(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /in/D6MPi on line 19

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:
42.6 ms | 401 KiB | 8 Q