3v4l.org

run code in 300+ PHP versions simultaneously
<?php $keys = array(); $header = array(); //get all keyes from first object foreach($q2 as $key){ $header[] = $key->row_name; } $q2a = json_decode(json_encode($q2), true); foreach($q2a as $q){ foreach($q as $k => $v){ $tmp_array[$k][] = $v; } } $output='<table><tr><th></th>'; foreach($header as $key){ $output .= '<th>' . $key . '</th>'; } $output .= '</tr>'; $tmp_array = array_slice($tmp_array, 1, -1); foreach($tmp_array as $key => $val){ $arl = count($val); $output .= '<tr>'; //display keys for($i = 0; $i < $arl ; $i++ ){ $output .= '<td>'. $key[$i] .'</td>'; //display values for($i = 0; $i < $arl; $i++ ){ $output .= '<td>'. $val[$i] .'</td>'; } $output .= '</tr>'; } } $output .= '</table>'; echo $output;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 28
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 28
Branch analysis from position: 19
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 26
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 26
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 26
Branch analysis from position: 28
2 jumps found. (Code = 77) Position 1 = 31, Position 2 = 36
Branch analysis from position: 31
2 jumps found. (Code = 78) Position 1 = 32, Position 2 = 36
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 36
2 jumps found. (Code = 77) Position 1 = 45, Position 2 = 70
Branch analysis from position: 45
2 jumps found. (Code = 78) Position 1 = 46, Position 2 = 70
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 67
Branch analysis from position: 67
2 jumps found. (Code = 44) Position 1 = 69, Position 2 = 52
Branch analysis from position: 69
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
Branch analysis from position: 52
1 jumps found. (Code = 42) Position 1 = 63
Branch analysis from position: 63
2 jumps found. (Code = 44) Position 1 = 65, Position 2 = 58
Branch analysis from position: 65
2 jumps found. (Code = 44) Position 1 = 69, Position 2 = 52
Branch analysis from position: 69
Branch analysis from position: 52
Branch analysis from position: 58
2 jumps found. (Code = 44) Position 1 = 65, Position 2 = 58
Branch analysis from position: 65
Branch analysis from position: 58
Branch analysis from position: 70
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 70
Branch analysis from position: 36
Branch analysis from position: 28
Branch analysis from position: 8
filename:       /in/qvuvi
function name:  (null)
number of ops:  74
compiled vars:  !0 = $keys, !1 = $header, !2 = $q2, !3 = $key, !4 = $q2a, !5 = $q, !6 = $v, !7 = $k, !8 = $tmp_array, !9 = $output, !10 = $val, !11 = $arl, !12 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    7     2      > FE_RESET_R                                       $15     !2, ->8
          3    > > FE_FETCH_R                                               $15, !3, ->8
    8     4    >   FETCH_OBJ_R                                      ~17     !3, 'row_name'
          5        ASSIGN_DIM                                               !1
          6        OP_DATA                                                  ~17
    7     7      > JMP                                                      ->3
          8    >   FE_FREE                                                  $15
   11     9        INIT_FCALL                                               'json_decode'
         10        INIT_FCALL                                               'json_encode'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $18     
         13        SEND_VAR                                                 $18
         14        SEND_VAL                                                 <true>
         15        DO_ICALL                                         $19     
         16        ASSIGN                                                   !4, $19
   12    17      > FE_RESET_R                                       $21     !4, ->28
         18    > > FE_FETCH_R                                               $21, !5, ->28
   13    19    > > FE_RESET_R                                       $22     !5, ->26
         20    > > FE_FETCH_R                                       ~23     $22, !6, ->26
         21    >   ASSIGN                                                   !7, ~23
   14    22        FETCH_DIM_W                                      $25     !8, !7
         23        ASSIGN_DIM                                               $25
         24        OP_DATA                                                  !6
   13    25      > JMP                                                      ->20
         26    >   FE_FREE                                                  $22
   12    27      > JMP                                                      ->18
         28    >   FE_FREE                                                  $21
   18    29        ASSIGN                                                   !9, '%3Ctable%3E%3Ctr%3E%3Cth%3E%3C%2Fth%3E'
   20    30      > FE_RESET_R                                       $28     !1, ->36
         31    > > FE_FETCH_R                                               $28, !3, ->36
   21    32    >   CONCAT                                           ~29     '%3Cth%3E', !3
         33        CONCAT                                           ~30     ~29, '%3C%2Fth%3E'
         34        ASSIGN_OP                                     8          !9, ~30
   20    35      > JMP                                                      ->31
         36    >   FE_FREE                                                  $28
   24    37        ASSIGN_OP                                     8          !9, '%3C%2Ftr%3E'
   26    38        INIT_FCALL                                               'array_slice'
         39        SEND_VAR                                                 !8
         40        SEND_VAL                                                 1
         41        SEND_VAL                                                 -1
         42        DO_ICALL                                         $33     
         43        ASSIGN                                                   !8, $33
   28    44      > FE_RESET_R                                       $35     !8, ->70
         45    > > FE_FETCH_R                                       ~36     $35, !10, ->70
         46    >   ASSIGN                                                   !3, ~36
   30    47        COUNT                                            ~38     !10
         48        ASSIGN                                                   !11, ~38
   31    49        ASSIGN_OP                                     8          !9, '%3Ctr%3E'
   34    50        ASSIGN                                                   !12, 0
         51      > JMP                                                      ->67
   35    52    >   FETCH_DIM_R                                      ~42     !3, !12
         53        CONCAT                                           ~43     '%3Ctd%3E', ~42
         54        CONCAT                                           ~44     ~43, '%3C%2Ftd%3E'
         55        ASSIGN_OP                                     8          !9, ~44
   38    56        ASSIGN                                                   !12, 0
         57      > JMP                                                      ->63
   39    58    >   FETCH_DIM_R                                      ~47     !10, !12
         59        CONCAT                                           ~48     '%3Ctd%3E', ~47
         60        CONCAT                                           ~49     ~48, '%3C%2Ftd%3E'
         61        ASSIGN_OP                                     8          !9, ~49
   38    62        PRE_INC                                                  !12
         63    >   IS_SMALLER                                               !12, !11
         64      > JMPNZ                                                    ~52, ->58
   42    65    >   ASSIGN_OP                                     8          !9, '%3C%2Ftr%3E'
   34    66        PRE_INC                                                  !12
         67    >   IS_SMALLER                                               !12, !11
         68      > JMPNZ                                                    ~55, ->52
   28    69    > > JMP                                                      ->45
         70    >   FE_FREE                                                  $35
   47    71        ASSIGN_OP                                     8          !9, '%3C%2Ftable%3E'
   49    72        ECHO                                                     !9
         73      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.18 ms | 1470 KiB | 16 Q