3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array(); $arr["TextosCodificados"]["TextoCodificado"]["0"]["QualificadorAssunto"]["0"] = "ALL"; $arr["TextosCodificados"]["TextoCodificado"]["0"]["Texto"] = "Vnd mer.adq.rec.ter.op.mer.sj.rg.sub.trb.cnd.sub.t"; $arr["TextosCodificados"]["TextoCodificado"]["1"]["QualificadorAssunto"]["0"] = "AAI"; $arr["TextosCodificados"]["TextoCodificado"]["1"]["Texto"] = "Protocolo ICMS 18809 e 1192012 ICMS Retido Art 313W"; $arr["TextosCodificados"]["TextoCodificado"]["2"]["QualificadorAssunto"]["0"] = "IVN"; $arr["TextosCodificados"]["TextoCodificado"]["2"]["Texto"] = "Pedido Interno:0000283278 ID da Carga:"; function teste($arr) { $ret = array() ; foreach($arr as $k => $v) { if(is_array($v)){ $ret.push(teste($v)); } else { $ret.push(array($k => $v)); //var_dump($k.' - '.$v); } } return $ret; } $rst = teste($arr); var_dump($rst);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/92Po9
function name:  (null)
number of ops:  42
compiled vars:  !0 = $arr, !1 = $rst
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        FETCH_DIM_W                                      $3      !0, 'TextosCodificados'
          2        FETCH_DIM_W                                      $4      $3, 'TextoCodificado'
          3        FETCH_DIM_W                                      $5      $4, 0
          4        FETCH_DIM_W                                      $6      $5, 'QualificadorAssunto'
          5        ASSIGN_DIM                                               $6, 0
          6        OP_DATA                                                  'ALL'
    6     7        FETCH_DIM_W                                      $8      !0, 'TextosCodificados'
          8        FETCH_DIM_W                                      $9      $8, 'TextoCodificado'
          9        FETCH_DIM_W                                      $10     $9, 0
         10        ASSIGN_DIM                                               $10, 'Texto'
         11        OP_DATA                                                  'Vnd+mer.adq.rec.ter.op.mer.sj.rg.sub.trb.cnd.sub.t'
    7    12        FETCH_DIM_W                                      $12     !0, 'TextosCodificados'
         13        FETCH_DIM_W                                      $13     $12, 'TextoCodificado'
         14        FETCH_DIM_W                                      $14     $13, 1
         15        FETCH_DIM_W                                      $15     $14, 'QualificadorAssunto'
         16        ASSIGN_DIM                                               $15, 0
         17        OP_DATA                                                  'AAI'
    8    18        FETCH_DIM_W                                      $17     !0, 'TextosCodificados'
         19        FETCH_DIM_W                                      $18     $17, 'TextoCodificado'
         20        FETCH_DIM_W                                      $19     $18, 1
         21        ASSIGN_DIM                                               $19, 'Texto'
         22        OP_DATA                                                  'Protocolo+ICMS+18809+e+1192012+ICMS+Retido+Art+313W'
    9    23        FETCH_DIM_W                                      $21     !0, 'TextosCodificados'
         24        FETCH_DIM_W                                      $22     $21, 'TextoCodificado'
         25        FETCH_DIM_W                                      $23     $22, 2
         26        FETCH_DIM_W                                      $24     $23, 'QualificadorAssunto'
         27        ASSIGN_DIM                                               $24, 0
         28        OP_DATA                                                  'IVN'
   10    29        FETCH_DIM_W                                      $26     !0, 'TextosCodificados'
         30        FETCH_DIM_W                                      $27     $26, 'TextoCodificado'
         31        FETCH_DIM_W                                      $28     $27, 2
         32        ASSIGN_DIM                                               $28, 'Texto'
         33        OP_DATA                                                  'Pedido+Interno%3A0000283278+ID+da+Carga%3A'
   25    34        INIT_FCALL                                               'teste'
         35        SEND_VAR                                                 !0
         36        DO_FCALL                                      0  $30     
         37        ASSIGN                                                   !1, $30
   26    38        INIT_FCALL                                               'var_dump'
         39        SEND_VAR                                                 !1
         40        DO_ICALL                                                 
         41      > RETURN                                                   1

Function teste:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 23
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 23
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 16
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/92Po9
function name:  teste
number of ops:  26
compiled vars:  !0 = $arr, !1 = $ret, !2 = $v, !3 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        ASSIGN                                                   !1, <array>
   14     2      > FE_RESET_R                                       $5      !0, ->23
          3    > > FE_FETCH_R                                       ~6      $5, !2, ->23
          4    >   ASSIGN                                                   !3, ~6
   16     5        TYPE_CHECK                                  128          !2
          6      > JMPZ                                                     ~8, ->16
   17     7    >   INIT_FCALL_BY_NAME                                       'push'
          8        INIT_FCALL_BY_NAME                                       'teste'
          9        SEND_VAR_EX                                              !2
         10        DO_FCALL                                      0  $9      
         11        SEND_VAR_NO_REF_EX                                       $9
         12        DO_FCALL                                      0  $10     
         13        CONCAT                                           ~11     !1, $10
         14        FREE                                                     ~11
         15      > JMP                                                      ->22
   19    16    >   INIT_FCALL_BY_NAME                                       'push'
         17        INIT_ARRAY                                       ~12     !2, !3
         18        SEND_VAL_EX                                              ~12
         19        DO_FCALL                                      0  $13     
         20        CONCAT                                           ~14     !1, $13
         21        FREE                                                     ~14
   14    22    > > JMP                                                      ->3
         23    >   FE_FREE                                                  $5
   23    24      > RETURN                                                   !1
   24    25*     > RETURN                                                   null

End of function teste

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.49 ms | 1403 KiB | 16 Q