3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* Programa para generar diccionarios de fuerza bruta con diferentes hilos usando Thread en PHP 5.4 */ class FuerzaBruta extends Thread { private $n; private $out; private $smap; public function FuerzaBruta($numero) { $this->n = $numero; // Numero de caracteres $this->smap = ['a','b','c','d']; $this->start(); } public function run(){ for($i = 0; $i < pow(count($this->smap), $this->n) - 1; $i++){ $this->visualizar(); $this->siguiente(); } $this->visualizar(); } public function siguiente(){ $this->out[0]++; $m = 0; while($this->out[$m] == count($this->smap)){ $this->out[$m++] = 0; $this->out[$m]++; } } public function visualizar(){ $output = ""; for($i = 0;$i < $this->n; $i++){ $output += $this->smap[$this->out[$i]]; } echo $output; } } //Genera todas las combinaciones de 5 caracteres. for($i = 1; $i < 5; $i++) new FuerzaBruta($i); // AlgĂșn error tendrĂ©...
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
Branch analysis from position: 3
filename:       /in/BiTAV
function name:  (null)
number of ops:  11
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   DECLARE_CLASS                                            'fuerzabruta', 'thread'
   53     1        ASSIGN                                                   !0, 1
          2      > JMP                                                      ->8
          3    >   NEW                                              $2      'FuerzaBruta'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6        FREE                                                     $2
          7        PRE_INC                                                  !0
          8    >   IS_SMALLER                                               !0, 5
          9      > JMPNZ                                                    ~5, ->3
   55    10    > > RETURN                                                   1

Class FuerzaBruta:
Function fuerzabruta:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BiTAV
function name:  FuerzaBruta
number of ops:  8
compiled vars:  !0 = $numero
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   16     1        ASSIGN_OBJ                                               'n'
          2        OP_DATA                                                  !0
   18     3        ASSIGN_OBJ                                               'smap'
          4        OP_DATA                                                  <array>
   20     5        INIT_METHOD_CALL                                         'start'
          6        DO_FCALL                                      0          
   21     7      > RETURN                                                   null

End of function fuerzabruta

Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 2
Branch analysis from position: 17
Branch analysis from position: 2
filename:       /in/BiTAV
function name:  run
number of ops:  20
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   ASSIGN                                                   !0, 0
          1      > JMP                                                      ->7
   25     2    >   INIT_METHOD_CALL                                         'visualizar'
          3        DO_FCALL                                      0          
   26     4        INIT_METHOD_CALL                                         'siguiente'
          5        DO_FCALL                                      0          
   24     6        PRE_INC                                                  !0
          7    >   INIT_FCALL                                               'pow'
          8        FETCH_OBJ_R                                      ~5      'smap'
          9        COUNT                                            ~6      ~5
         10        SEND_VAL                                                 ~6
         11        FETCH_OBJ_R                                      ~7      'n'
         12        SEND_VAL                                                 ~7
         13        DO_ICALL                                         $8      
         14        SUB                                              ~9      $8, 1
         15        IS_SMALLER                                               !0, ~9
         16      > JMPNZ                                                    ~10, ->2
   29    17    >   INIT_METHOD_CALL                                         'visualizar'
         18        DO_FCALL                                      0          
   30    19      > RETURN                                                   null

End of function run

Function siguiente:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 5
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 5
Branch analysis from position: 18
Branch analysis from position: 5
filename:       /in/BiTAV
function name:  siguiente
number of ops:  19
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   FETCH_OBJ_RW                                     $1      'out'
          1        FETCH_DIM_RW                                     $2      $1, 0
          2        PRE_INC                                                  $2
   34     3        ASSIGN                                                   !0, 0
   35     4      > JMP                                                      ->12
   36     5    >   POST_INC                                         ~6      !0
          6        FETCH_OBJ_W                                      $5      'out'
          7        ASSIGN_DIM                                               $5, ~6
          8        OP_DATA                                                  0
   37     9        FETCH_OBJ_RW                                     $8      'out'
         10        FETCH_DIM_RW                                     $9      $8, !0
         11        PRE_INC                                                  $9
   35    12    >   FETCH_OBJ_R                                      ~11     'out'
         13        FETCH_DIM_R                                      ~12     ~11, !0
         14        FETCH_OBJ_R                                      ~13     'smap'
         15        COUNT                                            ~14     ~13
         16        IS_EQUAL                                                 ~12, ~14
         17      > JMPNZ                                                    ~15, ->5
   39    18    > > RETURN                                                   null

End of function siguiente

Function visualizar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 3
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 3
Branch analysis from position: 12
Branch analysis from position: 3
filename:       /in/BiTAV
function name:  visualizar
number of ops:  14
compiled vars:  !0 = $output, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   42     0  E >   ASSIGN                                                   !0, ''
   43     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->9
   44     3    >   FETCH_OBJ_R                                      ~5      'out'
          4        FETCH_DIM_R                                      ~6      ~5, !1
          5        FETCH_OBJ_R                                      ~4      'smap'
          6        FETCH_DIM_R                                      ~7      ~4, ~6
          7        ASSIGN_OP                                     1          !0, ~7
   43     8        PRE_INC                                                  !1
          9    >   FETCH_OBJ_R                                      ~10     'n'
         10        IS_SMALLER                                               !1, ~10
         11      > JMPNZ                                                    ~11, ->3
   47    12    >   ECHO                                                     !0
   48    13      > RETURN                                                   null

End of function visualizar

End of class FuerzaBruta.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.55 ms | 1404 KiB | 15 Q