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) { $row = array_pad($row,$rows,''); 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 = 61
Branch analysis from position: 36
2 jumps found. (Code = 78) Position 1 = 37, Position 2 = 61
Branch analysis from position: 37
2 jumps found. (Code = 125) Position 1 = 44, Position 2 = 53
Branch analysis from position: 44
2 jumps found. (Code = 126) Position 1 = 45, Position 2 = 53
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
Branch analysis from position: 53
Branch analysis from position: 61
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 61
Branch analysis from position: 31
filename:       /in/U8aO3
function name:  (null)
number of ops:  63
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, ->61
         36    > > FE_FETCH_R                                               $27, !3, ->61
   33    37    >   INIT_FCALL                                               'array_pad'
         38        SEND_VAR                                                 !3
         39        SEND_VAR                                                 !2
         40        SEND_VAL                                                 ''
         41        DO_ICALL                                         $28     
         42        ASSIGN                                                   !3, $28
   34    43      > FE_RESET_RW                                      $30     !3, ->53
         44    > > FE_FETCH_RW                                      ~31     $30, !4, ->53
         45    >   ASSIGN                                                   !6, ~31
   35    46        INIT_FCALL                                               'str_pad'
         47        SEND_VAR                                                 !4
         48        FETCH_DIM_R                                      ~33     !1, !6
         49        SEND_VAL                                                 ~33
         50        DO_ICALL                                         $34     
         51        ASSIGN                                                   !4, $34
   34    52      > JMP                                                      ->44
         53    >   FE_FREE                                                  $30
   36    54        INIT_FCALL                                               'implode'
         55        SEND_VAR                                                 !3
         56        SEND_VAL                                                 '+%23+'
         57        DO_ICALL                                         $36     
         58        CONCAT                                           ~37     $36, '%0A'
         59        ECHO                                                     ~37
   32    60      > JMP                                                      ->36
         61    >   FE_FREE                                                  $27
   53    62      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
215.69 ms | 1400 KiB | 21 Q