3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrErros = array('teste de log 1','log vermelho com preto','log amarelo e roxo','quatro paredes em azul','azul eh a cor do oceano','no ocenano tem peixes marinhos','vermelho nao combina com azul',); //THRESHOLD PARA CÁLCULO DE SIMILARIDADE $threshold = 60; //INDEXAR VETOR DE PESQUISA $matriz_indexada = array(); $matriz_resultado = array(); foreach ($arrErros as $chave => $valor){ $matriz_indexada[$chave]['valor'] = $valor; $matriz_indexada[$chave]['chave'] = $chave; $matriz_indexada[$chave]['used'] = 0; } //CONSTRUIR VETOR DE SIMILARIDADE $totallinha = count($matriz_indexada); for ($i=0; $i<$totallinha-1; $i++){ $matriz_resultado[$i]['mensagem'] = $matriz_indexada[$i]['valor']; $matriz_resultado[$i]['count'] = 1; if ($matriz_indexada[$i]['used'] != 1){ for ($j=$i+1; $j<$totallinha; $j++){ similar_text($matriz_indexada[$i]['valor'], $matriz_indexada[$j]['valor'], $percent); if (($percent >= $threshold)){ $matriz_indexada[$j]['used'] = 1; //$matriz_resultado[$i]['mensagem'] = $matriz_resultado[$i]['mensagem']."<BR>".$matriz_indexada[$j]['valor']; $matriz_resultado[$i]['mensagem'] = $matriz_resultado[$i]['mensagem']; $matriz_resultado[$i]['count']++; } } } } //ORDENAR VETOR COM BUBBLE SORT $totallinha = count($matriz_resultado); for ($i=0; $i<$totallinha-1; $i++){ for ($j=0; $j<$totallinha-1; $j++){ if ($matriz_resultado[$i]['count'] > $matriz_resultado[$j]['count']){ $mensagem = $matriz_resultado[$i]['mensagem']; $count = $matriz_resultado[$i]['count']; $matriz_resultado[$i]['mensagem'] = $matriz_resultado[$j]['mensagem']; $matriz_resultado[$i]['count'] = $matriz_resultado[$j]['count']; $matriz_resultado[$j]['mensagem'] = $mensagem; $matriz_resultado[$j]['count'] = $count; } } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 17
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 17
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 63
Branch analysis from position: 63
2 jumps found. (Code = 44) Position 1 = 66, Position 2 = 22
Branch analysis from position: 66
1 jumps found. (Code = 42) Position 1 = 105
Branch analysis from position: 105
2 jumps found. (Code = 44) Position 1 = 108, Position 2 = 70
Branch analysis from position: 108
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 70
1 jumps found. (Code = 42) Position 1 = 101
Branch analysis from position: 101
2 jumps found. (Code = 44) Position 1 = 104, Position 2 = 72
Branch analysis from position: 104
2 jumps found. (Code = 44) Position 1 = 108, Position 2 = 70
Branch analysis from position: 108
Branch analysis from position: 70
Branch analysis from position: 72
2 jumps found. (Code = 43) Position 1 = 78, Position 2 = 100
Branch analysis from position: 78
2 jumps found. (Code = 44) Position 1 = 104, Position 2 = 72
Branch analysis from position: 104
Branch analysis from position: 72
Branch analysis from position: 100
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 62
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 60
Branch analysis from position: 60
2 jumps found. (Code = 44) Position 1 = 62, Position 2 = 37
Branch analysis from position: 62
2 jumps found. (Code = 44) Position 1 = 66, Position 2 = 22
Branch analysis from position: 66
Branch analysis from position: 22
Branch analysis from position: 37
2 jumps found. (Code = 43) Position 1 = 48, Position 2 = 59
Branch analysis from position: 48
2 jumps found. (Code = 44) Position 1 = 62, Position 2 = 37
Branch analysis from position: 62
Branch analysis from position: 37
Branch analysis from position: 59
Branch analysis from position: 62
Branch analysis from position: 17
filename:       /in/0MS8K
function name:  (null)
number of ops:  109
compiled vars:  !0 = $arrErros, !1 = $threshold, !2 = $matriz_indexada, !3 = $matriz_resultado, !4 = $valor, !5 = $chave, !6 = $totallinha, !7 = $i, !8 = $j, !9 = $percent, !10 = $mensagem, !11 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    6     1        ASSIGN                                                   !1, 60
    9     2        ASSIGN                                                   !2, <array>
   10     3        ASSIGN                                                   !3, <array>
   11     4      > FE_RESET_R                                       $16     !0, ->17
          5    > > FE_FETCH_R                                       ~17     $16, !4, ->17
          6    >   ASSIGN                                                   !5, ~17
   12     7        FETCH_DIM_W                                      $19     !2, !5
          8        ASSIGN_DIM                                               $19, 'valor'
          9        OP_DATA                                                  !4
   13    10        FETCH_DIM_W                                      $21     !2, !5
         11        ASSIGN_DIM                                               $21, 'chave'
         12        OP_DATA                                                  !5
   14    13        FETCH_DIM_W                                      $23     !2, !5
         14        ASSIGN_DIM                                               $23, 'used'
         15        OP_DATA                                                  0
   11    16      > JMP                                                      ->5
         17    >   FE_FREE                                                  $16
   19    18        COUNT                                            ~25     !2
         19        ASSIGN                                                   !6, ~25
   20    20        ASSIGN                                                   !7, 0
         21      > JMP                                                      ->63
   21    22    >   FETCH_DIM_R                                      ~30     !2, !7
         23        FETCH_DIM_R                                      ~31     ~30, 'valor'
         24        FETCH_DIM_W                                      $28     !3, !7
         25        ASSIGN_DIM                                               $28, 'mensagem'
         26        OP_DATA                                                  ~31
   22    27        FETCH_DIM_W                                      $32     !3, !7
         28        ASSIGN_DIM                                               $32, 'count'
         29        OP_DATA                                                  1
   23    30        FETCH_DIM_R                                      ~34     !2, !7
         31        FETCH_DIM_R                                      ~35     ~34, 'used'
         32        IS_NOT_EQUAL                                             ~35, 1
         33      > JMPZ                                                     ~36, ->62
   24    34    >   ADD                                              ~37     !7, 1
         35        ASSIGN                                                   !8, ~37
         36      > JMP                                                      ->60
   25    37    >   INIT_FCALL                                               'similar_text'
         38        FETCH_DIM_R                                      ~39     !2, !7
         39        FETCH_DIM_R                                      ~40     ~39, 'valor'
         40        SEND_VAL                                                 ~40
         41        FETCH_DIM_R                                      ~41     !2, !8
         42        FETCH_DIM_R                                      ~42     ~41, 'valor'
         43        SEND_VAL                                                 ~42
         44        SEND_REF                                                 !9
         45        DO_ICALL                                                 
   26    46        IS_SMALLER_OR_EQUAL                                      !1, !9
         47      > JMPZ                                                     ~44, ->59
   27    48    >   FETCH_DIM_W                                      $45     !2, !8
         49        ASSIGN_DIM                                               $45, 'used'
         50        OP_DATA                                                  1
   29    51        FETCH_DIM_R                                      ~49     !3, !7
         52        FETCH_DIM_R                                      ~50     ~49, 'mensagem'
         53        FETCH_DIM_W                                      $47     !3, !7
         54        ASSIGN_DIM                                               $47, 'mensagem'
         55        OP_DATA                                                  ~50
   30    56        FETCH_DIM_RW                                     $51     !3, !7
         57        FETCH_DIM_RW                                     $52     $51, 'count'
         58        PRE_INC                                                  $52
   24    59    >   PRE_INC                                                  !8
         60    >   IS_SMALLER                                               !8, !6
         61      > JMPNZ                                                    ~55, ->37
   20    62    >   PRE_INC                                                  !7
         63    >   SUB                                              ~57     !6, 1
         64        IS_SMALLER                                               !7, ~57
         65      > JMPNZ                                                    ~58, ->22
   37    66    >   COUNT                                            ~59     !3
         67        ASSIGN                                                   !6, ~59
   38    68        ASSIGN                                                   !7, 0
         69      > JMP                                                      ->105
   39    70    >   ASSIGN                                                   !8, 0
         71      > JMP                                                      ->101
   40    72    >   FETCH_DIM_R                                      ~63     !3, !7
         73        FETCH_DIM_R                                      ~64     ~63, 'count'
         74        FETCH_DIM_R                                      ~65     !3, !8
         75        FETCH_DIM_R                                      ~66     ~65, 'count'
         76        IS_SMALLER                                               ~66, ~64
         77      > JMPZ                                                     ~67, ->100
   41    78    >   FETCH_DIM_R                                      ~68     !3, !7
         79        FETCH_DIM_R                                      ~69     ~68, 'mensagem'
         80        ASSIGN                                                   !10, ~69
   42    81        FETCH_DIM_R                                      ~71     !3, !7
         82        FETCH_DIM_R                                      ~72     ~71, 'count'
         83        ASSIGN                                                   !11, ~72
   44    84        FETCH_DIM_R                                      ~76     !3, !8
         85        FETCH_DIM_R                                      ~77     ~76, 'mensagem'
         86        FETCH_DIM_W                                      $74     !3, !7
         87        ASSIGN_DIM                                               $74, 'mensagem'
         88        OP_DATA                                                  ~77
   45    89        FETCH_DIM_R                                      ~80     !3, !8
         90        FETCH_DIM_R                                      ~81     ~80, 'count'
         91        FETCH_DIM_W                                      $78     !3, !7
         92        ASSIGN_DIM                                               $78, 'count'
         93        OP_DATA                                                  ~81
   47    94        FETCH_DIM_W                                      $82     !3, !8
         95        ASSIGN_DIM                                               $82, 'mensagem'
         96        OP_DATA                                                  !10
   48    97        FETCH_DIM_W                                      $84     !3, !8
         98        ASSIGN_DIM                                               $84, 'count'
         99        OP_DATA                                                  !11
   39   100    >   PRE_INC                                                  !8
        101    >   SUB                                              ~87     !6, 1
        102        IS_SMALLER                                               !8, ~87
        103      > JMPNZ                                                    ~88, ->72
   38   104    >   PRE_INC                                                  !7
        105    >   SUB                                              ~90     !6, 1
        106        IS_SMALLER                                               !7, ~90
        107      > JMPNZ                                                    ~91, ->70
   51   108    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.36 ms | 1404 KiB | 15 Q