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','teste de log 1A'); //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; } */ foreach($arrErros as $chave => $msg) { $matriz_resultado[$chave]['msg'] = $msg; $matriz_resultado[$chave]['count'] = 1; if (@$matriz_resultado[$chave]['used'] != 1) { foreach($arrErros as $chave2 => $msg2) { similar_text($msg,$msg2,$percent); if (($percent >= $threshold)){ $matriz_resultado[$chave]['msg'] = $msg; $matriz_resultado[$chave]['count']++; $matriz_resultado[$chave2]['used'] = 1; } } } } /* //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']; $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; } } } */ print_r($matriz_resultado);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 39
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 39
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 38
Branch analysis from position: 17
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 37
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 37
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 36
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 36
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 37
Branch analysis from position: 38
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
filename:       /in/4jMOR
function name:  (null)
number of ops:  44
compiled vars:  !0 = $arrErros, !1 = $threshold, !2 = $msg, !3 = $chave, !4 = $matriz_resultado, !5 = $msg2, !6 = $chave2, !7 = $percent
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    6     1        ASSIGN                                                   !1, 60
   19     2      > FE_RESET_R                                       $10     !0, ->39
          3    > > FE_FETCH_R                                       ~11     $10, !2, ->39
          4    >   ASSIGN                                                   !3, ~11
   21     5        FETCH_DIM_W                                      $13     !4, !3
          6        ASSIGN_DIM                                               $13, 'msg'
          7        OP_DATA                                                  !2
   22     8        FETCH_DIM_W                                      $15     !4, !3
          9        ASSIGN_DIM                                               $15, 'count'
         10        OP_DATA                                                  1
   24    11        BEGIN_SILENCE                                    ~17     
         12        FETCH_DIM_R                                      ~18     !4, !3
         13        FETCH_DIM_R                                      ~19     ~18, 'used'
         14        END_SILENCE                                              ~17
         15        IS_NOT_EQUAL                                             ~19, 1
         16      > JMPZ                                                     ~20, ->38
   26    17    > > FE_RESET_R                                       $21     !0, ->37
         18    > > FE_FETCH_R                                       ~22     $21, !5, ->37
         19    >   ASSIGN                                                   !6, ~22
   28    20        INIT_FCALL                                               'similar_text'
         21        SEND_VAR                                                 !2
         22        SEND_VAR                                                 !5
         23        SEND_REF                                                 !7
         24        DO_ICALL                                                 
   29    25        IS_SMALLER_OR_EQUAL                                      !1, !7
         26      > JMPZ                                                     ~25, ->36
   30    27    >   FETCH_DIM_W                                      $26     !4, !3
         28        ASSIGN_DIM                                               $26, 'msg'
         29        OP_DATA                                                  !2
   31    30        FETCH_DIM_RW                                     $28     !4, !3
         31        FETCH_DIM_RW                                     $29     $28, 'count'
         32        PRE_INC                                                  $29
   32    33        FETCH_DIM_W                                      $31     !4, !6
         34        ASSIGN_DIM                                               $31, 'used'
         35        OP_DATA                                                  1
   26    36    > > JMP                                                      ->18
         37    >   FE_FREE                                                  $21
   19    38    > > JMP                                                      ->3
         39    >   FE_FREE                                                  $10
   74    40        INIT_FCALL                                               'print_r'
         41        SEND_VAR                                                 !4
         42        DO_ICALL                                                 
         43      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.23 ms | 1392 KiB | 17 Q