3v4l.org

run code in 300+ PHP versions simultaneously
<?php function replace_between_something($betweenWhat, $replace_thing, $target) { return preg_replace("/" . preg_quote($betweenWhat) . "(.*?)" . preg_quote($betweenWhat) . "/", $betweenWhat.$replace_thing.$betweenWhat, $target); } $string = "Hi, *my* name is 'Soul' and she is 'Maggie'. "; $replace = replace_between_something("*", "your", $string) . "\n"; $replace = replace_between_something("'", "noname", $replace); echo $replace;
Output for git.master, git.master_jit, rfc.property-hooks
Hi, *your* name is 'noname' and she is 'noname'.

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:
162.78 ms | 405 KiB | 5 Q