3v4l.org

run code in 300+ PHP versions simultaneously
<?php $list = array( "Michigan" => "9", "Data Structure" => "10", "Database" => "11", "Creativity" => "12", "Forest" => "13", "Al Pacino" => "14", "Humans" => "15", "Technology" => "16" ); $post = array (Michigan, Delaware); $all_key_values = $all_keys = array(); foreach ($post as $keyword) { foreach ($list as $word=>$num) { $sim_chars = similar_text($keyword, $word); if ($sim_chars/strlen($keyword) ==1 && $sim_chars/strlen($word) ==1) { $all_key_values[] = $num; $all_keys[] = $word; } elseif (stripos($keyword, $word) !== false || strpos($word, $keyword) !== false) { $sll_key_values[] = $num; $all_keys[] = $word; } } } print_r(implode(',', $all_key_values)); echo "\n"; print_r(implode(',', $all_keys));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 52
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 52
Branch analysis from position: 10
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 50
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 50
Branch analysis from position: 12
2 jumps found. (Code = 46) Position 1 = 22, Position 2 = 26
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 32
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 32
2 jumps found. (Code = 47) Position 1 = 38, Position 2 = 44
Branch analysis from position: 38
2 jumps found. (Code = 43) Position 1 = 45, Position 2 = 49
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 49
Branch analysis from position: 44
Branch analysis from position: 26
Branch analysis from position: 50
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 50
Branch analysis from position: 52
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 52
filename:       /in/OrXiH
function name:  (null)
number of ops:  69
compiled vars:  !0 = $list, !1 = $post, !2 = $all_key_values, !3 = $all_keys, !4 = $keyword, !5 = $num, !6 = $word, !7 = $sim_chars, !8 = $sll_key_values
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
   15     1        FETCH_CONSTANT                                   ~10     'Michigan'
          2        INIT_ARRAY                                       ~11     ~10
          3        FETCH_CONSTANT                                   ~12     'Delaware'
          4        ADD_ARRAY_ELEMENT                                ~11     ~12
          5        ASSIGN                                                   !1, ~11
   17     6        ASSIGN                                           ~14     !3, <array>
          7        ASSIGN                                                   !2, ~14
   19     8      > FE_RESET_R                                       $16     !1, ->52
          9    > > FE_FETCH_R                                               $16, !4, ->52
   20    10    > > FE_RESET_R                                       $17     !0, ->50
         11    > > FE_FETCH_R                                       ~18     $17, !5, ->50
         12    >   ASSIGN                                                   !6, ~18
   21    13        INIT_FCALL                                               'similar_text'
         14        SEND_VAR                                                 !4
         15        SEND_VAR                                                 !6
         16        DO_ICALL                                         $20     
         17        ASSIGN                                                   !7, $20
   22    18        STRLEN                                           ~22     !4
         19        DIV                                              ~23     !7, ~22
         20        IS_EQUAL                                         ~24     ~23, 1
         21      > JMPZ_EX                                          ~24     ~24, ->26
         22    >   STRLEN                                           ~25     !6
         23        DIV                                              ~26     !7, ~25
         24        IS_EQUAL                                         ~27     ~26, 1
         25        BOOL                                             ~24     ~27
         26    > > JMPZ                                                     ~24, ->32
   23    27    >   ASSIGN_DIM                                               !2
         28        OP_DATA                                                  !5
   24    29        ASSIGN_DIM                                               !3
         30        OP_DATA                                                  !6
         31      > JMP                                                      ->49
   26    32    >   INIT_FCALL                                               'stripos'
         33        SEND_VAR                                                 !4
         34        SEND_VAR                                                 !6
         35        DO_ICALL                                         $30     
         36        TYPE_CHECK                                  1018  ~31     $30
         37      > JMPNZ_EX                                         ~31     ~31, ->44
         38    >   INIT_FCALL                                               'strpos'
         39        SEND_VAR                                                 !6
         40        SEND_VAR                                                 !4
         41        DO_ICALL                                         $32     
         42        TYPE_CHECK                                  1018  ~33     $32
         43        BOOL                                             ~31     ~33
         44    > > JMPZ                                                     ~31, ->49
   27    45    >   ASSIGN_DIM                                               !8
         46        OP_DATA                                                  !5
   28    47        ASSIGN_DIM                                               !3
         48        OP_DATA                                                  !6
   20    49    > > JMP                                                      ->11
         50    >   FE_FREE                                                  $17
   19    51      > JMP                                                      ->9
         52    >   FE_FREE                                                  $16
   33    53        INIT_FCALL                                               'print_r'
         54        INIT_FCALL                                               'implode'
         55        SEND_VAL                                                 '%2C'
         56        SEND_VAR                                                 !2
         57        DO_ICALL                                         $36     
         58        SEND_VAR                                                 $36
         59        DO_ICALL                                                 
   34    60        ECHO                                                     '%0A'
   35    61        INIT_FCALL                                               'print_r'
         62        INIT_FCALL                                               'implode'
         63        SEND_VAL                                                 '%2C'
         64        SEND_VAR                                                 !3
         65        DO_ICALL                                         $38     
         66        SEND_VAR                                                 $38
         67        DO_ICALL                                                 
         68      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.42 ms | 1400 KiB | 23 Q