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;}function joinsigns($array){ $singsArray=array("ि","्"); $out=array($array[0]); for ($i=1; $i <count($array) ; $i++) { if (in_array($array[$i], $singsArray)) { $out[count($out)-1].=$array[$i]; }else{ $out[]=$array[$i]; } } return $out;}$a = "मायने";$ar=mbStringToArray($a);print_r($ar);echo "<br>";print_r(joinsigns($ar));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HeTnL
function name:  (null)
number of ops:  16
compiled vars:  !0 = $a, !1 = $ar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ASSIGN                                                   !0, '%E0%A4%AE%E0%A4%BE%E0%A4%AF%E0%A4%A8%E0%A5%87'
          1        INIT_FCALL                                               'mbstringtoarray'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $3      
          4        ASSIGN                                                   !1, $3
          5        INIT_FCALL                                               'print_r'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
          8        ECHO                                                     '%3Cbr%3E'
          9        INIT_FCALL                                               'print_r'
         10        INIT_FCALL                                               'joinsigns'
         11        SEND_VAR                                                 !1
         12        DO_FCALL                                      0  $6      
         13        SEND_VAR                                                 $6
         14        DO_ICALL                                                 
         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/HeTnL
function name:  mbStringToArray
number of ops:  28
compiled vars:  !0 = $string, !1 = $strlen, !2 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'mb_strlen'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !1, $3
          5      > JMP                                                      ->25
          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
         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
         21        INIT_FCALL                                               'mb_strlen'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                         $9      
         24        ASSIGN                                                   !1, $9
         25    > > JMPNZ                                                    !1, ->6
         26    > > RETURN                                                   !2
         27*     > RETURN                                                   null

End of function mbstringtoarray

Function joinsigns:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 7
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 19
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 7
Branch analysis from position: 26
Branch analysis from position: 7
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 7
Branch analysis from position: 26
Branch analysis from position: 7
filename:       /in/HeTnL
function name:  joinsigns
number of ops:  28
compiled vars:  !0 = $array, !1 = $singsArray, !2 = $out, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   RECV                                             !0      
          1        ASSIGN                                                   !1, <array>
          2        FETCH_DIM_R                                      ~5      !0, 0
          3        INIT_ARRAY                                       ~6      ~5
          4        ASSIGN                                                   !2, ~6
          5        ASSIGN                                                   !3, 1
          6      > JMP                                                      ->23
          7    >   INIT_FCALL                                               'in_array'
          8        FETCH_DIM_R                                      ~9      !0, !3
          9        SEND_VAL                                                 ~9
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $10     
         12      > JMPZ                                                     $10, ->19
         13    >   COUNT                                            ~11     !2
         14        SUB                                              ~12     ~11, 1
         15        FETCH_DIM_R                                      ~14     !0, !3
         16        ASSIGN_DIM_OP                .=               8          !2, ~12
         17        OP_DATA                                                  ~14
         18      > JMP                                                      ->22
         19    >   FETCH_DIM_R                                      ~16     !0, !3
         20        ASSIGN_DIM                                               !2
         21        OP_DATA                                                  ~16
         22    >   PRE_INC                                                  !3
         23    >   COUNT                                            ~18     !0
         24        IS_SMALLER                                               !3, ~18
         25      > JMPNZ                                                    ~19, ->7
         26    > > RETURN                                                   !2
         27*     > RETURN                                                   null

End of function joinsigns

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.52 ms | 1407 KiB | 23 Q