3v4l.org

run code in 300+ PHP versions simultaneously
<?php function substr_count_array($string, $arr) { foreach ($arr as $letter) $count[$letter] += substr_count($string, $letter); return $count; } $str = 'óóómaóríaéé'; print_r(substr_count_array($str, array("á","é","í","ó")));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nBDgT
function name:  (null)
number of ops:  9
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, '%C3%B3%C3%B3%C3%B3ma%C3%B3r%C3%ADa%C3%A9%C3%A9'
   10     1        INIT_FCALL                                               'print_r'
          2        INIT_FCALL                                               'substr_count_array'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 <array>
          5        DO_FCALL                                      0  $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function substr_count_array:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/nBDgT
function name:  substr_count_array
number of ops:  14
compiled vars:  !0 = $string, !1 = $arr, !2 = $letter, !3 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2      > FE_RESET_R                                       $4      !1, ->11
          3    > > FE_FETCH_R                                               $4, !2, ->11
    5     4    >   INIT_FCALL                                               'substr_count'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                         $6      
          8        ASSIGN_DIM_OP                +=               1          !3, !2
          9        OP_DATA                                                  $6
    4    10      > JMP                                                      ->3
         11    >   FE_FREE                                                  $4
    6    12      > RETURN                                                   !3
    7    13*     > RETURN                                                   null

End of function substr_count_array

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.21 ms | 1398 KiB | 18 Q