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); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HTSWO
function name:  (null)
number of ops:  16
compiled vars:  !0 = $a, !1 = $lol, !2 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                   !0, '%E0%A4%86%E0%A4%B2%E0%A5%8B%E0%A4%95'
   12     1        INIT_FCALL                                               'mbstringtoarray'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $4      
          4        ASSIGN                                                   !1, $4
   13     5        INIT_FCALL                                               'print_r'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
   14     8        INIT_FCALL                                               'json_decode'
          9        SEND_VAL                                                 '%22%5Cu093F%22'
         10        DO_ICALL                                         $7      
         11        ASSIGN                                                   !2, $7
   30    12        INIT_FCALL                                               'countvowels'
         13        SEND_VAR                                                 !1
         14        DO_FCALL                                      0          
   32    15      > RETURN                                                   1

Function mbstringtoarray:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 6
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 6
Branch analysis from position: 26
Branch analysis from position: 6
filename:       /in/HTSWO
function name:  mbStringToArray
number of ops:  28
compiled vars:  !0 = $string, !1 = $strlen, !2 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL                                               'mb_strlen'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !1, $3
    4     5      > JMP                                                      ->25
    5     6    >   INIT_FCALL                                               'mb_substr'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 0
          9        SEND_VAL                                                 1
         10        SEND_VAL                                                 'UTF-8'
         11        DO_ICALL                                         $6      
         12        ASSIGN_DIM                                               !2
         13        OP_DATA                                                  $6
    6    14        INIT_FCALL                                               'mb_substr'
         15        SEND_VAR                                                 !0
         16        SEND_VAL                                                 1
         17        SEND_VAR                                                 !1
         18        SEND_VAL                                                 'UTF-8'
         19        DO_ICALL                                         $7      
         20        ASSIGN                                                   !0, $7
    7    21        INIT_FCALL                                               'mb_strlen'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                         $9      
         24        ASSIGN                                                   !1, $9
    4    25    > > JMPNZ                                                    !1, ->6
    9    26    > > RETURN                                                   !2
   10    27*     > RETURN                                                   null

End of function mbstringtoarray

Function countvowels:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 6
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 22
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 29
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 22
Branch analysis from position: 33
Branch analysis from position: 22
Branch analysis from position: 29
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 6
Branch analysis from position: 20
Branch analysis from position: 6
filename:       /in/HTSWO
function name:  countVowels
number of ops:  35
compiled vars:  !0 = $req, !1 = $hindi, !2 = $vowels, !3 = $vowelcount, !4 = $i, !5 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        ASSIGN                                                   !1, <array>
   17     2        ASSIGN                                                   !2, <array>
   18     3        ASSIGN                                                   !3, 0
   19     4        ASSIGN                                                   !4, 0
          5      > JMP                                                      ->17
   20     6    >   INIT_FCALL                                               'array_push'
          7        SEND_REF                                                 !2
          8        INIT_FCALL                                               'json_decode'
          9        FETCH_DIM_R                                      ~10     !1, !4
         10        CONCAT                                           ~11     '%22', ~10
         11        CONCAT                                           ~12     ~11, '%22'
         12        SEND_VAL                                                 ~12
         13        DO_ICALL                                         $13     
         14        SEND_VAR                                                 $13
         15        DO_ICALL                                                 
   19    16        PRE_INC                                                  !4
         17    >   COUNT                                            ~16     !1
         18        IS_SMALLER                                               !4, ~16
         19      > JMPNZ                                                    ~17, ->6
   23    20    >   ASSIGN                                                   !5, 0
         21      > JMP                                                      ->30
   24    22    >   INIT_FCALL                                               'in_array'
         23        FETCH_DIM_R                                      ~19     !0, !5
         24        SEND_VAL                                                 ~19
         25        SEND_VAR                                                 !2
         26        DO_ICALL                                         $20     
         27      > JMPZ                                                     $20, ->29
   25    28    >   PRE_INC                                                  !3
   23    29    >   PRE_INC                                                  !5
         30    >   COUNT                                            ~23     !0
         31        IS_SMALLER                                               !5, ~23
         32      > JMPNZ                                                    ~24, ->22
   27    33    >   ECHO                                                     !3
   28    34      > RETURN                                                   null

End of function countvowels

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.11 ms | 1443 KiB | 21 Q