3v4l.org

run code in 300+ PHP versions simultaneously
<? function persian($word) { $prefix_list=array('na','bi','be','sər'); $prefix_count=count($prefix_list); $dictionary=array ( 'mərd'=>'man', 'kar'=>'work', 'çarə'=>'solution' ); for($index=0;$index<$prefix_count;$index++) //4 { $prefix=$prefix_list[$index]; $prefix_length=strlen($prefix); //2 2 2 3 $word_prefix=substr($word,0,$prefix_length); //namerd - na if($word_prefix==$prefix) { $root=substr($word,$prefix_length); //namerd, 2 2 2 3 return $root; } } } $word='namərd'; //$word='bekar'; //$word='biçarə'; //$word='sərbəst'; #1. koku 2. tercume persian($word); echo 'salam'; ?>
Output for git.master, git.master_jit, rfc.property-hooks
<? function persian($word) { $prefix_list=array('na','bi','be','sər'); $prefix_count=count($prefix_list); $dictionary=array ( 'mərd'=>'man', 'kar'=>'work', 'çarə'=>'solution' ); for($index=0;$index<$prefix_count;$index++) //4 { $prefix=$prefix_list[$index]; $prefix_length=strlen($prefix); //2 2 2 3 $word_prefix=substr($word,0,$prefix_length); //namerd - na if($word_prefix==$prefix) { $root=substr($word,$prefix_length); //namerd, 2 2 2 3 return $root; } } } $word='namərd'; //$word='bekar'; //$word='biçarə'; //$word='sərbəst'; #1. koku 2. tercume persian($word); echo 'salam'; ?>

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:
59.22 ms | 402 KiB | 8 Q