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 (stripos($keyword, $word) !== false || strpos($word, $keyword) !== false) { $all_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 = 48
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 48
Branch analysis from position: 6
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 46
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 46
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 = 45
Branch analysis from position: 45
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 = 34, Position 2 = 40
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 45
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 45
Branch analysis from position: 40
Branch analysis from position: 22
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 46
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 48
filename:       /in/8M9Oe
function name:  (null)
number of ops:  65
compiled vars:  !0 = $list, !1 = $post, !2 = $all_key_values, !3 = $all_keys, !4 = $keyword, !5 = $num, !6 = $word, !7 = $sim_chars
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
   15     1        ASSIGN                                                   !1, <array>
   17     2        ASSIGN                                           ~10     !3, <array>
          3        ASSIGN                                                   !2, ~10
   19     4      > FE_RESET_R                                       $12     !1, ->48
          5    > > FE_FETCH_R                                               $12, !4, ->48
   20     6    > > FE_RESET_R                                       $13     !0, ->46
          7    > > FE_FETCH_R                                       ~14     $13, !5, ->46
          8    >   ASSIGN                                                   !6, ~14
   21     9        INIT_FCALL                                               'similar_text'
         10        SEND_VAR                                                 !4
         11        SEND_VAR                                                 !6
         12        DO_ICALL                                         $16     
         13        ASSIGN                                                   !7, $16
   22    14        STRLEN                                           ~18     !4
         15        DIV                                              ~19     !7, ~18
         16        IS_SMALLER                                       ~20     0.8, ~19
         17      > JMPNZ_EX                                         ~20     ~20, ->22
         18    >   STRLEN                                           ~21     !6
         19        DIV                                              ~22     !7, ~21
         20        IS_SMALLER                                       ~23     0.8, ~22
         21        BOOL                                             ~20     ~23
         22    > > JMPZ                                                     ~20, ->28
   23    23    >   ASSIGN_DIM                                               !2
         24        OP_DATA                                                  !5
   24    25        ASSIGN_DIM                                               !3
         26        OP_DATA                                                  !6
         27      > JMP                                                      ->45
   26    28    >   INIT_FCALL                                               'stripos'
         29        SEND_VAR                                                 !4
         30        SEND_VAR                                                 !6
         31        DO_ICALL                                         $26     
         32        TYPE_CHECK                                  1018  ~27     $26
         33      > JMPNZ_EX                                         ~27     ~27, ->40
         34    >   INIT_FCALL                                               'strpos'
         35        SEND_VAR                                                 !6
         36        SEND_VAR                                                 !4
         37        DO_ICALL                                         $28     
         38        TYPE_CHECK                                  1018  ~29     $28
         39        BOOL                                             ~27     ~29
         40    > > JMPZ                                                     ~27, ->45
   27    41    >   ASSIGN_DIM                                               !2
         42        OP_DATA                                                  !5
   28    43        ASSIGN_DIM                                               !3
         44        OP_DATA                                                  !6
   20    45    > > JMP                                                      ->7
         46    >   FE_FREE                                                  $13
   19    47      > JMP                                                      ->5
         48    >   FE_FREE                                                  $12
   33    49        INIT_FCALL                                               'print_r'
         50        INIT_FCALL                                               'implode'
         51        SEND_VAL                                                 '%2C'
         52        SEND_VAR                                                 !2
         53        DO_ICALL                                         $32     
         54        SEND_VAR                                                 $32
         55        DO_ICALL                                                 
   34    56        ECHO                                                     '%0A'
   35    57        INIT_FCALL                                               'print_r'
         58        INIT_FCALL                                               'implode'
         59        SEND_VAL                                                 '%2C'
         60        SEND_VAR                                                 !3
         61        DO_ICALL                                         $34     
         62        SEND_VAR                                                 $34
         63        DO_ICALL                                                 
         64      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.99 ms | 1395 KiB | 24 Q