3v4l.org

run code in 300+ PHP versions simultaneously
<?php $list = array( "Data" => "9", "Data Structure" => "10", "Database" => "11", "Creativity" => "12", "Forest" => "13", "Al Pacino" => "14", "Humans" => "15", "Technology" => "16" ); $post = array ('Database', 'Law', 'Tech', 'Creative'); $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) > .8 || $sim_chars/strlen($word) > .8) { $all_key_values[] = $num; $all_keys[] = $word; } elseif (fnmatch('*'.$keyword.'*', $word) || fnmatch('*'.$word.'*', $keyword) ) { $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 = 5, Position 2 = 50
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 50
Branch analysis from position: 6
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 48
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 48
Branch analysis from position: 8
2 jumps found. (Code = 47) Position 1 = 18, Position 2 = 22
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 28
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 47
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 28
2 jumps found. (Code = 47) Position 1 = 35, Position 2 = 42
Branch analysis from position: 35
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 47
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 47
Branch analysis from position: 42
Branch analysis from position: 22
Branch analysis from position: 48
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 48
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 50
filename:       /in/CLWE9
function name:  (null)
number of ops:  67
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        ASSIGN                                                   !1, <array>
   17     2        ASSIGN                                           ~11     !3, <array>
          3        ASSIGN                                                   !2, ~11
   19     4      > FE_RESET_R                                       $13     !1, ->50
          5    > > FE_FETCH_R                                               $13, !4, ->50
   20     6    > > FE_RESET_R                                       $14     !0, ->48
          7    > > FE_FETCH_R                                       ~15     $14, !5, ->48
          8    >   ASSIGN                                                   !6, ~15
   21     9        INIT_FCALL                                               'similar_text'
         10        SEND_VAR                                                 !4
         11        SEND_VAR                                                 !6
         12        DO_ICALL                                         $17     
         13        ASSIGN                                                   !7, $17
   22    14        STRLEN                                           ~19     !4
         15        DIV                                              ~20     !7, ~19
         16        IS_SMALLER                                       ~21     0.8, ~20
         17      > JMPNZ_EX                                         ~21     ~21, ->22
         18    >   STRLEN                                           ~22     !6
         19        DIV                                              ~23     !7, ~22
         20        IS_SMALLER                                       ~24     0.8, ~23
         21        BOOL                                             ~21     ~24
         22    > > JMPZ                                                     ~21, ->28
   23    23    >   ASSIGN_DIM                                               !2
         24        OP_DATA                                                  !5
   24    25        ASSIGN_DIM                                               !3
         26        OP_DATA                                                  !6
         27      > JMP                                                      ->47
   26    28    >   INIT_FCALL                                               'fnmatch'
         29        CONCAT                                           ~27     '%2A', !4
         30        CONCAT                                           ~28     ~27, '%2A'
         31        SEND_VAL                                                 ~28
         32        SEND_VAR                                                 !6
         33        DO_ICALL                                         $29     
         34      > JMPNZ_EX                                         ~30     $29, ->42
         35    >   INIT_FCALL                                               'fnmatch'
         36        CONCAT                                           ~31     '%2A', !6
         37        CONCAT                                           ~32     ~31, '%2A'
         38        SEND_VAL                                                 ~32
         39        SEND_VAR                                                 !4
         40        DO_ICALL                                         $33     
         41        BOOL                                             ~30     $33
         42    > > JMPZ                                                     ~30, ->47
   27    43    >   ASSIGN_DIM                                               !8
         44        OP_DATA                                                  !5
   28    45        ASSIGN_DIM                                               !3
         46        OP_DATA                                                  !6
   20    47    > > JMP                                                      ->7
         48    >   FE_FREE                                                  $14
   19    49      > JMP                                                      ->5
         50    >   FE_FREE                                                  $13
   33    51        INIT_FCALL                                               'print_r'
         52        INIT_FCALL                                               'implode'
         53        SEND_VAL                                                 '%2C'
         54        SEND_VAR                                                 !2
         55        DO_ICALL                                         $36     
         56        SEND_VAR                                                 $36
         57        DO_ICALL                                                 
   34    58        ECHO                                                     '%0A'
   35    59        INIT_FCALL                                               'print_r'
         60        INIT_FCALL                                               'implode'
         61        SEND_VAL                                                 '%2C'
         62        SEND_VAR                                                 !3
         63        DO_ICALL                                         $38     
         64        SEND_VAR                                                 $38
         65        DO_ICALL                                                 
         66      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.21 ms | 1392 KiB | 21 Q