3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sed(string $re, string $sub): string { if (mb_strlen($re, "8bit") < 4 || $re[0] !== "s") throw new Error("Your syntax is invalid, go drown yourself"); [1 => $re, 2 => $rep, 3 => $mod] = preg_split("|(?<!\\\\){$re[1]}|", $re); $re = str_replace('@', '\@', $re); return preg_replace("@$re@$mod", $rep, $sub); } echo sed('s/Cat/Fox/i', 'Cat makes dog play guitar.'), PHP_EOL;
Output for git.master, git.master_jit, rfc.property-hooks
Fox makes dog play guitar.

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