3v4l.org

run code in 300+ PHP versions simultaneously
<?php $title="服务员"; $termKey=array("服务","服务员"); if($title && !empty($termKey) && is_array($termKey)){ $newTitle = $title; $cur = count($termKey) - 1; //倒叙匹配 for($i=$cur;$i >= 0 ;--$i) { if($termKey[$i] && strstr($newTitle , $termKey[$i])) { $str = '<span class="fc-red">'.$termKey[$i].'</span>'; $newTitle = preg_replace("/$termKey[$i]/i" , $str , $newTitle,1); echo $newTitle; } } } echo $newTitle;
Output for git.master, git.master_jit, rfc.property-hooks
<span class="fc-red">服务员</span><span class="fc-red"><span class="fc-red">服务</span>员</span><span class="fc-red"><span class="fc-red">服务</span>员</span>

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