3v4l.org

run code in 300+ PHP versions simultaneously
<?php $variavel = array( 0 => array( 'id' => 1, 'Nome' => 'Andre', 'Sexo' => 'Masculino', 'Dependente' => 'Fabiana', 'DependenteSexo' => 'Femenino', ), 1 => array( 'id' => 1, 'Nome' => 'Andre', 'Sexo' => 'Masculino', 'Dependente' => 'Gato', 'DependenteSexo' => 'Femenino', ), 2 => array( 'id' => 1, 'Nome' => 'Andre', 'Sexo' => 'Masculino', 'Dependente' => 'Mãe', 'DependenteSexo' => 'Femenino', ), 3 => array( 'id' => 1, 'Nome' => 'Andre', 'Sexo' => 'Masculino', 'Dependente' => 'Pai', 'DependenteSexo' => 'Masculino', ), 4 => array( 'id' => 2, 'Nome' => 'Kleber', 'Sexo' => 'Masculino', 'Dependente' => 'Thayssa', 'DependenteSexo' => 'Femenino', ), 5 => array( 'id' => 2, 'Nome' => 'Kleber', 'Sexo' => 'Masculino', 'Dependente' => 'Gato', 'DependenteSexo' => 'Femenino', ), 6 => array( 'id' => 2, 'Nome' => 'Kleber', 'Sexo' => 'Masculino', 'Dependente' => 'Mãe', 'DependenteSexo' => 'Femenino', ), 7 => array( 'id' => 2, 'Nome' => 'Kleber', 'Sexo' => 'Masculino', 'Dependente' => 'Pai', 'DependenteSexo' => 'Masculino', ), ); /** * Andre */ $user = array(); foreach ($variavel as $v) { if (!in_array($v['id'], $user)) { $user[$v['id']] = array( 'nome' => $v['Nome'], 'sexo' => $v['Sexo'] ); } } foreach ($variavel as $v) { $user[$v['id']]['dependentes'][] = array( 'nome' => $v['Dependente'], 'sexo' => $v['DependenteSexo'] ); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 19
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 19
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 18
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 18
Branch analysis from position: 19
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 32
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 32
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
Branch analysis from position: 19
filename:       /in/BYtUp
function name:  (null)
number of ops:  34
compiled vars:  !0 = $variavel, !1 = $user, !2 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   65     1        ASSIGN                                                   !1, <array>
   66     2      > FE_RESET_R                                       $5      !0, ->19
          3    > > FE_FETCH_R                                               $5, !2, ->19
   67     4    >   INIT_FCALL                                               'in_array'
          5        FETCH_DIM_R                                      ~6      !2, 'id'
          6        SEND_VAL                                                 ~6
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $7      
          9        BOOL_NOT                                         ~8      $7
         10      > JMPZ                                                     ~8, ->18
   68    11    >   FETCH_DIM_R                                      ~9      !2, 'id'
   69    12        FETCH_DIM_R                                      ~11     !2, 'Nome'
         13        INIT_ARRAY                                       ~12     ~11, 'nome'
   70    14        FETCH_DIM_R                                      ~13     !2, 'Sexo'
         15        ADD_ARRAY_ELEMENT                                ~12     ~13, 'sexo'
   68    16        ASSIGN_DIM                                               !1, ~9
   70    17        OP_DATA                                                  ~12
   66    18    > > JMP                                                      ->3
         19    >   FE_FREE                                                  $5
   75    20      > FE_RESET_R                                       $14     !0, ->32
         21    > > FE_FETCH_R                                               $14, !2, ->32
   76    22    >   FETCH_DIM_R                                      ~15     !2, 'id'
   77    23        FETCH_DIM_R                                      ~19     !2, 'Dependente'
         24        INIT_ARRAY                                       ~20     ~19, 'nome'
   78    25        FETCH_DIM_R                                      ~21     !2, 'DependenteSexo'
         26        ADD_ARRAY_ELEMENT                                ~20     ~21, 'sexo'
   76    27        FETCH_DIM_W                                      $16     !1, ~15
         28        FETCH_DIM_W                                      $17     $16, 'dependentes'
         29        ASSIGN_DIM                                               $17
   78    30        OP_DATA                                                  ~20
   75    31      > JMP                                                      ->21
         32    >   FE_FREE                                                  $14
   80    33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.24 ms | 1396 KiB | 15 Q