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', ), ); /** * Kleber */ $i = -1; $j = 0; $id = null; $usuarios = array(); foreach ($variavel as $v) { if ($v['id'] != $id) { $j = 0; ++$i; $id = $v['id']; $usuarios[$i]['Nome'] = $v['Nome']; $usuarios[$i]['Sexo'] = $v['Sexo']; } $usuarios[$i]['denpendetes'][$j]['Nome'] = $v['Dependente']; $usuarios[$i]['denpendetes'][$j]['Sexo'] = $v['DependenteSexo']; $j++; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 36
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 36
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 22
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 22
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
filename:       /in/psGG5
function name:  (null)
number of ops:  38
compiled vars:  !0 = $variavel, !1 = $i, !2 = $j, !3 = $id, !4 = $usuarios, !5 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
   66     1        ASSIGN                                                   !1, -1
   67     2        ASSIGN                                                   !2, 0
   68     3        ASSIGN                                                   !3, null
   69     4        ASSIGN                                                   !4, <array>
   70     5      > FE_RESET_R                                       $11     !0, ->36
          6    > > FE_FETCH_R                                               $11, !5, ->36
   71     7    >   FETCH_DIM_R                                      ~12     !5, 'id'
          8        IS_NOT_EQUAL                                             !3, ~12
          9      > JMPZ                                                     ~13, ->22
   72    10    >   ASSIGN                                                   !2, 0
   73    11        PRE_INC                                                  !1
   74    12        FETCH_DIM_R                                      ~16     !5, 'id'
         13        ASSIGN                                                   !3, ~16
   75    14        FETCH_DIM_R                                      ~20     !5, 'Nome'
         15        FETCH_DIM_W                                      $18     !4, !1
         16        ASSIGN_DIM                                               $18, 'Nome'
         17        OP_DATA                                                  ~20
   76    18        FETCH_DIM_R                                      ~23     !5, 'Sexo'
         19        FETCH_DIM_W                                      $21     !4, !1
         20        ASSIGN_DIM                                               $21, 'Sexo'
         21        OP_DATA                                                  ~23
   78    22    >   FETCH_DIM_R                                      ~28     !5, 'Dependente'
         23        FETCH_DIM_W                                      $24     !4, !1
         24        FETCH_DIM_W                                      $25     $24, 'denpendetes'
         25        FETCH_DIM_W                                      $26     $25, !2
         26        ASSIGN_DIM                                               $26, 'Nome'
         27        OP_DATA                                                  ~28
   79    28        FETCH_DIM_R                                      ~33     !5, 'DependenteSexo'
         29        FETCH_DIM_W                                      $29     !4, !1
         30        FETCH_DIM_W                                      $30     $29, 'denpendetes'
         31        FETCH_DIM_W                                      $31     $30, !2
         32        ASSIGN_DIM                                               $31, 'Sexo'
         33        OP_DATA                                                  ~33
   80    34        PRE_INC                                                  !2
   70    35      > JMP                                                      ->6
         36    >   FE_FREE                                                  $11
   81    37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.61 ms | 1390 KiB | 13 Q