3v4l.org

run code in 500+ PHP versions simultaneously
<?php function my_replace(string $fullText, string $searchText){ $searches = explode(' ',$searchText); $replace = array(); foreach ($searches as $i => $search){ $position = strlen($search)+stripos($fullText, $search); $fullText = substr_replace($fullText, '<- ', $position, 0); } return $fullText; } echo my_replace('A week ago, Elvis left the Building', 'elvis left bonk');
Output for git.master, git.master_jit, rfc.property-hooks
A we<- ek ago, Elvis<- left<- the Building

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:
55.27 ms | 1597 KiB | 4 Q