3v4l.org

run code in 300+ PHP versions simultaneously
<?php $d = array( array( "id", "int(10) unsigned", "NO", "PRI", "auto_increment" ), array( "title", "varchar(32)", "NO" ), array( "author", "varchar(32)", "NO" ), array( "category", "tinyint(3) unsigned", "NO" ), array( "date", "datetime", "NO" ), array( "post_ip", "int(10) unsigned", "NO" ), array( "approved_by", "varchar(32)", "NO" ), array( "text", "text", "NO" ) ); $cols = array(); $rows = 0; foreach ($d as $row) { ($rows < count($row) && $rows = count($row)); foreach($row as $id => $col) { (!isset($cols[$id]) && $cols[$id] = 0); ($cols[$id] < strlen($col) && $cols[$id] = strlen($col)); } } print_R($cols); foreach ($d as $row) { foreach ($row as $colid => &$col) $col = str_pad($col, $cols[$colid]); echo implode($row," # ") . "\n"; } /* id # int(10) unsigned # NO # PRI # auto_increment # [19:44] <teehee> title # varchar(32) # NO # [19:44] <teehee> author # varchar(32) # NO # [19:44] <teehee> category # tinyint(3) unsigned # NO # [19:44] <teehee> date # datetime # NO # [19:44] <teehee> post_ip # int(10) unsigned # NO # [19:44] <teehee> approved_by # varchar(32) # YES # [19:44] <teehee> text # text # NO # */
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 31
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 31
Branch analysis from position: 5
2 jumps found. (Code = 46) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 29
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 29
Branch analysis from position: 13
2 jumps found. (Code = 46) Position 1 = 17, Position 2 = 20
Branch analysis from position: 17
2 jumps found. (Code = 46) Position 1 = 24, Position 2 = 28
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 28
Branch analysis from position: 20
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 29
Branch analysis from position: 11
Branch analysis from position: 31
2 jumps found. (Code = 77) Position 1 = 36, Position 2 = 55
Branch analysis from position: 36
2 jumps found. (Code = 78) Position 1 = 37, Position 2 = 55
Branch analysis from position: 37
2 jumps found. (Code = 125) Position 1 = 38, Position 2 = 47
Branch analysis from position: 38
2 jumps found. (Code = 126) Position 1 = 39, Position 2 = 47
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
Branch analysis from position: 47
Branch analysis from position: 55
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 55
Branch analysis from position: 31
filename:       /in/Fs4G5
function name:  (null)
number of ops:  57
compiled vars:  !0 = $d, !1 = $cols, !2 = $rows, !3 = $row, !4 = $col, !5 = $id, !6 = $colid
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   22     1        ASSIGN                                                   !1, <array>
   23     2        ASSIGN                                                   !2, 0
   24     3      > FE_RESET_R                                       $10     !0, ->31
          4    > > FE_FETCH_R                                               $10, !3, ->31
   25     5    >   COUNT                                            ~11     !3
          6        IS_SMALLER                                       ~12     !2, ~11
          7      > JMPZ_EX                                          ~12     ~12, ->11
          8    >   COUNT                                            ~13     !3
          9        ASSIGN                                           ~14     !2, ~13
         10        BOOL                                             ~12     ~14
   26    11    > > FE_RESET_R                                       $15     !3, ->29
         12    > > FE_FETCH_R                                       ~16     $15, !4, ->29
         13    >   ASSIGN                                                   !5, ~16
   27    14        ISSET_ISEMPTY_DIM_OBJ                         0  ~18     !1, !5
         15        BOOL_NOT                                         ~19     ~18
         16      > JMPZ_EX                                          ~19     ~19, ->20
         17    >   ASSIGN_DIM                                       ~20     !1, !5
         18        OP_DATA                                                  0
         19        BOOL                                             ~19     ~20
   28    20    >   FETCH_DIM_R                                      ~21     !1, !5
         21        STRLEN                                           ~22     !4
         22        IS_SMALLER                                       ~23     ~21, ~22
         23      > JMPZ_EX                                          ~23     ~23, ->28
         24    >   STRLEN                                           ~25     !4
         25        ASSIGN_DIM                                       ~24     !1, !5
         26        OP_DATA                                                  ~25
         27        BOOL                                             ~23     ~24
   26    28    > > JMP                                                      ->12
         29    >   FE_FREE                                                  $15
   24    30      > JMP                                                      ->4
         31    >   FE_FREE                                                  $10
   31    32        INIT_FCALL                                               'print_r'
         33        SEND_VAR                                                 !1
         34        DO_ICALL                                                 
   32    35      > FE_RESET_R                                       $27     !0, ->55
         36    > > FE_FETCH_R                                               $27, !3, ->55
   33    37    > > FE_RESET_RW                                      $28     !3, ->47
         38    > > FE_FETCH_RW                                      ~29     $28, !4, ->47
         39    >   ASSIGN                                                   !6, ~29
   34    40        INIT_FCALL                                               'str_pad'
         41        SEND_VAR                                                 !4
         42        FETCH_DIM_R                                      ~31     !1, !6
         43        SEND_VAL                                                 ~31
         44        DO_ICALL                                         $32     
         45        ASSIGN                                                   !4, $32
   33    46      > JMP                                                      ->38
         47    >   FE_FREE                                                  $28
   35    48        INIT_FCALL                                               'implode'
         49        SEND_VAR                                                 !3
         50        SEND_VAL                                                 '+%23+'
         51        DO_ICALL                                         $34     
         52        CONCAT                                           ~35     $34, '%0A'
         53        ECHO                                                     ~35
   32    54      > JMP                                                      ->36
         55    >   FE_FREE                                                  $27
   52    56      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.68 ms | 1392 KiB | 19 Q