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'); $matches = 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) { $matches[] = $num; } } } print_r($matches);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 27
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 27
Branch analysis from position: 5
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 25
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 25
Branch analysis from position: 7
2 jumps found. (Code = 47) Position 1 = 17, Position 2 = 21
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 24
Branch analysis from position: 21
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 25
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/WDmYm
function name:  (null)
number of ops:  32
compiled vars:  !0 = $list, !1 = $post, !2 = $matches, !3 = $keyword, !4 = $num, !5 = $word, !6 = $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                                                   !2, <array>
   19     3      > FE_RESET_R                                       $10     !1, ->27
          4    > > FE_FETCH_R                                               $10, !3, ->27
   20     5    > > FE_RESET_R                                       $11     !0, ->25
          6    > > FE_FETCH_R                                       ~12     $11, !4, ->25
          7    >   ASSIGN                                                   !5, ~12
   21     8        INIT_FCALL                                               'similar_text'
          9        SEND_VAR                                                 !3
         10        SEND_VAR                                                 !5
         11        DO_ICALL                                         $14     
         12        ASSIGN                                                   !6, $14
   23    13        STRLEN                                           ~16     !3
         14        DIV                                              ~17     !6, ~16
         15        IS_SMALLER                                       ~18     0.8, ~17
         16      > JMPNZ_EX                                         ~18     ~18, ->21
         17    >   STRLEN                                           ~19     !5
         18        DIV                                              ~20     !6, ~19
         19        IS_SMALLER                                       ~21     0.8, ~20
         20        BOOL                                             ~18     ~21
         21    > > JMPZ                                                     ~18, ->24
   24    22    >   ASSIGN_DIM                                               !2
         23        OP_DATA                                                  !4
   20    24    > > JMP                                                      ->6
         25    >   FE_FREE                                                  $11
   19    26      > JMP                                                      ->4
         27    >   FE_FREE                                                  $10
   29    28        INIT_FCALL                                               'print_r'
         29        SEND_VAR                                                 !2
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.9 ms | 1396 KiB | 17 Q