3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string1 = "abacadeee"; $string2 = "aabbccddee"; $counts2 = count_chars($string2, 1); $tally = 0; foreach (array_intersect_key(count_chars($string1, 1), $counts2) as $charcode1 => $count1) { $tally += min($counts2[$charcode1], $count1); ///echo $charcode1 , ": " , min($counts2[$charcode1], $count1) , "\n"; } echo $tally;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 26
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 26
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/RA6WL
function name:  (null)
number of ops:  29
compiled vars:  !0 = $string1, !1 = $string2, !2 = $counts2, !3 = $tally, !4 = $count1, !5 = $charcode1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'abacadeee'
    3     1        ASSIGN                                                   !1, 'aabbccddee'
    5     2        INIT_FCALL                                               'count_chars'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 1
          5        DO_ICALL                                         $8      
          6        ASSIGN                                                   !2, $8
    7     7        ASSIGN                                                   !3, 0
    8     8        INIT_FCALL                                               'array_intersect_key'
          9        INIT_FCALL                                               'count_chars'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 1
         12        DO_ICALL                                         $11     
         13        SEND_VAR                                                 $11
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                         $12     
         16      > FE_RESET_R                                       $13     $12, ->26
         17    > > FE_FETCH_R                                       ~14     $13, !4, ->26
         18    >   ASSIGN                                                   !5, ~14
    9    19        INIT_FCALL                                               'min'
         20        FETCH_DIM_R                                      ~16     !2, !5
         21        SEND_VAL                                                 ~16
         22        SEND_VAR                                                 !4
         23        DO_ICALL                                         $17     
         24        ASSIGN_OP                                     1          !3, $17
    8    25      > JMP                                                      ->17
         26    >   FE_FREE                                                  $13
   12    27        ECHO                                                     !3
   13    28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.36 ms | 1013 KiB | 16 Q