3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'maríaé'; function substr_count_array( $haystack, $needle ) { $count = 0; foreach ($needle as $substring) { $count[$substring] += substr_count( $haystack, $substring); } return $count; } 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/7siHP
function name:  (null)
number of ops:  9
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'mar%C3%ADa%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 = 4, Position 2 = 12
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/7siHP
function name:  substr_count_array
number of ops:  15
compiled vars:  !0 = $haystack, !1 = $needle, !2 = $count, !3 = $substring
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        ASSIGN                                                   !2, 0
    5     3      > FE_RESET_R                                       $5      !1, ->12
          4    > > FE_FETCH_R                                               $5, !3, ->12
    6     5    >   INIT_FCALL                                               'substr_count'
          6        SEND_VAR                                                 !0
          7        SEND_VAR                                                 !3
          8        DO_ICALL                                         $7      
          9        ASSIGN_DIM_OP                +=               1          !2, !3
         10        OP_DATA                                                  $7
    5    11      > JMP                                                      ->4
         12    >   FE_FREE                                                  $5
    8    13      > RETURN                                                   !2
    9    14*     > RETURN                                                   null

End of function substr_count_array

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.01 ms | 1399 KiB | 18 Q