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) { foreach($arrErros as $chave2 => $msg2) { similar_text($msg,$msg2,$percent); if (($percent >= $threshold)){ $matriz_resultado[$chave]['msg'] = $msg; $matriz_resultado[$chave]['count']++; } } } /* //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; } } } */ print_r($matriz_resultado);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 24
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 24
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 22
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 22
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 21
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 21
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 22
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/BQocq
function name:  (null)
number of ops:  29
compiled vars:  !0 = $arrErros, !1 = $threshold, !2 = $msg, !3 = $chave, !4 = $msg2, !5 = $chave2, !6 = $percent, !7 = $matriz_resultado
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, ->24
          3    > > FE_FETCH_R                                       ~11     $10, !2, ->24
          4    >   ASSIGN                                                   !3, ~11
   21     5      > FE_RESET_R                                       $13     !0, ->22
          6    > > FE_FETCH_R                                       ~14     $13, !4, ->22
          7    >   ASSIGN                                                   !5, ~14
   23     8        INIT_FCALL                                               'similar_text'
          9        SEND_VAR                                                 !2
         10        SEND_VAR                                                 !4
         11        SEND_REF                                                 !6
         12        DO_ICALL                                                 
   24    13        IS_SMALLER_OR_EQUAL                                      !1, !6
         14      > JMPZ                                                     ~17, ->21
   25    15    >   FETCH_DIM_W                                      $18     !7, !3
         16        ASSIGN_DIM                                               $18, 'msg'
         17        OP_DATA                                                  !2
   26    18        FETCH_DIM_RW                                     $20     !7, !3
         19        FETCH_DIM_RW                                     $21     $20, 'count'
         20        PRE_INC                                                  $21
   21    21    > > JMP                                                      ->6
         22    >   FE_FREE                                                  $13
   19    23      > JMP                                                      ->3
         24    >   FE_FREE                                                  $10
   70    25        INIT_FCALL                                               'print_r'
         26        SEND_VAR                                                 !7
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.51 ms | 1396 KiB | 17 Q