3v4l.org

run code in 300+ PHP versions simultaneously
<?php function str_replace_chr(string $str, int $position, string $format): string { $chr = $str[$position - 1]; $p1 = $position - 1; $p2 = ($p1 + 1 ) - strlen($str); $replace = sprintf($format,$chr); return substr_replace($str,$replace,$p1,$p2); } echo str_replace_chr('VietJack Team', 5, '<span style="color: red;">%s</span>');
Output for git.master_jit, git.master, rfc.property-hooks
Viet<span style="color: red;">J</span>ack Team

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