3v4l.org

run code in 300+ PHP versions simultaneously
<?php function colorSequences($i1,$i2) { $m = strlen($i1); $n = strlen($i2); $at = str_split($i2); $count = 0; for($i=0;$i<$m;$i++){ if(count($i2) > 0){ if( in_array($i1[$i],$at) ){ $key = array_search($i1[$i],$at); unset($at[$key]); }else{ $count++; } }else{ $count++; } } return $count; } echo colorSequences("bc","abc"); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kJKjl
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   INIT_FCALL                                               'colorsequences'
          1        SEND_VAL                                                 'bc'
          2        SEND_VAL                                                 'abc'
          3        DO_FCALL                                      0  $0      
          4        ECHO                                                     $0
   33     5      > RETURN                                                   1

Function colorsequences:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 13
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 32
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 30
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 13
Branch analysis from position: 36
Branch analysis from position: 13
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 13
Branch analysis from position: 36
Branch analysis from position: 13
filename:       /in/kJKjl
function name:  colorSequences
number of ops:  38
compiled vars:  !0 = $i1, !1 = $i2, !2 = $m, !3 = $n, !4 = $at, !5 = $count, !6 = $i, !7 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        STRLEN                                           ~8      !0
          3        ASSIGN                                                   !2, ~8
    7     4        STRLEN                                           ~10     !1
          5        ASSIGN                                                   !3, ~10
    8     6        INIT_FCALL                                               'str_split'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $12     
          9        ASSIGN                                                   !4, $12
    9    10        ASSIGN                                                   !5, 0
   11    11        ASSIGN                                                   !6, 0
         12      > JMP                                                      ->34
   12    13    >   COUNT                                            ~16     !1
         14        IS_SMALLER                                               0, ~16
         15      > JMPZ                                                     ~17, ->32
   13    16    >   INIT_FCALL                                               'in_array'
         17        FETCH_DIM_R                                      ~18     !0, !6
         18        SEND_VAL                                                 ~18
         19        SEND_VAR                                                 !4
         20        DO_ICALL                                         $19     
         21      > JMPZ                                                     $19, ->30
   14    22    >   INIT_FCALL                                               'array_search'
         23        FETCH_DIM_R                                      ~20     !0, !6
         24        SEND_VAL                                                 ~20
         25        SEND_VAR                                                 !4
         26        DO_ICALL                                         $21     
         27        ASSIGN                                                   !7, $21
   15    28        UNSET_DIM                                                !4, !7
         29      > JMP                                                      ->31
   17    30    >   PRE_INC                                                  !5
         31    > > JMP                                                      ->33
   20    32    >   PRE_INC                                                  !5
   11    33    >   PRE_INC                                                  !6
         34    >   IS_SMALLER                                               !6, !2
         35      > JMPNZ                                                    ~26, ->13
   23    36    > > RETURN                                                   !5
   24    37*     > RETURN                                                   null

End of function colorsequences

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.23 ms | 1403 KiB | 20 Q