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, $percent); if ($percent > 80) { $all_key_values[] = $num; $all_keys[] = $word; } //elseif ($sim_chars/strlen($keyword) > .8 || $sim_chars/strlen($word) > .8) { // $all_key_values[] = $num; // $all_keys[] = $word; // } elseif (strpos($keyword, $word) !== false || strpos($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 = 41
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 41
Branch analysis from position: 6
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 39
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 39
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 22
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 22
2 jumps found. (Code = 47) Position 1 = 28, Position 2 = 33
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 38
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 38
Branch analysis from position: 33
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 39
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
filename:       /in/VEKBG
function name:  (null)
number of ops:  58
compiled vars:  !0 = $list, !1 = $post, !2 = $all_key_values, !3 = $all_keys, !4 = $keyword, !5 = $num, !6 = $word, !7 = $sim_chars, !8 = $percent, !9 = $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                                           ~12     !3, <array>
          3        ASSIGN                                                   !2, ~12
   19     4      > FE_RESET_R                                       $14     !1, ->41
          5    > > FE_FETCH_R                                               $14, !4, ->41
   20     6    > > FE_RESET_R                                       $15     !0, ->39
          7    > > FE_FETCH_R                                       ~16     $15, !5, ->39
          8    >   ASSIGN                                                   !6, ~16
   21     9        INIT_FCALL                                               'similar_text'
         10        SEND_VAR                                                 !4
         11        SEND_VAR                                                 !6
         12        SEND_REF                                                 !8
         13        DO_ICALL                                         $18     
         14        ASSIGN                                                   !7, $18
   22    15        IS_SMALLER                                               80, !8
         16      > JMPZ                                                     ~20, ->22
   23    17    >   ASSIGN_DIM                                               !2
         18        OP_DATA                                                  !5
   24    19        ASSIGN_DIM                                               !3
         20        OP_DATA                                                  !6
         21      > JMP                                                      ->38
   30    22    >   INIT_FCALL                                               'strpos'
         23        SEND_VAR                                                 !4
         24        SEND_VAR                                                 !6
         25        DO_ICALL                                         $23     
         26        TYPE_CHECK                                  1018  ~24     $23
         27      > JMPNZ_EX                                         ~24     ~24, ->33
         28    >   INIT_FCALL                                               'strpos'
         29        SEND_VAR                                                 !6
         30        SEND_VAR                                                 !4
         31        DO_ICALL                                         $25     
         32        BOOL                                             ~24     $25
         33    > > JMPZ                                                     ~24, ->38
   31    34    >   ASSIGN_DIM                                               !9
         35        OP_DATA                                                  !5
   32    36        ASSIGN_DIM                                               !3
         37        OP_DATA                                                  !6
   20    38    > > JMP                                                      ->7
         39    >   FE_FREE                                                  $15
   19    40      > JMP                                                      ->5
         41    >   FE_FREE                                                  $14
   37    42        INIT_FCALL                                               'print_r'
         43        INIT_FCALL                                               'implode'
         44        SEND_VAL                                                 '%2C'
         45        SEND_VAR                                                 !2
         46        DO_ICALL                                         $28     
         47        SEND_VAR                                                 $28
         48        DO_ICALL                                                 
   38    49        ECHO                                                     '%0A'
   39    50        INIT_FCALL                                               'print_r'
         51        INIT_FCALL                                               'implode'
         52        SEND_VAL                                                 '%2C'
         53        SEND_VAR                                                 !3
         54        DO_ICALL                                         $30     
         55        SEND_VAR                                                 $30
         56        DO_ICALL                                                 
         57      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.54 ms | 1400 KiB | 21 Q