3v4l.org

run code in 300+ PHP versions simultaneously
<?php function mbStringToArray ($string) { $strlen = mb_strlen($string); while ($strlen) { $array[] = mb_substr($string,0,1,"UTF-8"); $string = mb_substr($string,1,$strlen,"UTF-8"); $strlen = mb_strlen($string); } return $array; } $a = "आलोक"; $lol = mbStringToArray($a); print_r($lol); $test = json_decode('"\u093F"'); function countVowels($req){ $hindi = array("\u0906","\u0908","\u093E","\u093F","\u0945","\u0946","\u0947","\u0948","\u0949","\u094A","\u094B","\u094C","\u094D"); $vowels= array(); $vowelcount = 0; for($i = 0; $i<count($hindi); $i++){ array_push($vowels,json_decode('"'.$hindi[$i].'"')); } for($j=0;$j<count($req);$j++){ if(in_array($req[$j], $vowels)) $vowelcount++; } echo $vowelcount; } countVowels($lol); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => आ [1] => ल [2] => ो [3] => क ) 2

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