3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "Jenny's garden is one of the best in town, it has lush greens and colorful flowers. With what happened to her recently, she could use a new sprinkler system so that she does not have to over exert herself. Perhaps Joel can sell that extra bike to raise money or perhaps put up a garage sale."; $keyword = "garden"; $length = 136; if ($keyword != "") { $strpos = strpos($string, $keyword); $strStart = substr($string, $strpos - ($length / 2), $length / 2); $strEnd = substr($string, $strpos + strlen($keyword), $length / 2); $result = $strStart . $keyword . $strEnd; } else { $result = substr($string, 0, $length); } echo $result;
Output for git.master, git.master_jit, rfc.property-hooks
t extra bike to raise money or perhaps put up a garage sale.garden is one of the best in town, it has lush greens and colorful flowers

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