3v4l.org

run code in 500+ PHP versions simultaneously
<?php //no. of ques $total_ques = 45; //creating array for que no $que_nos = range(1,(int)$total_ques); $part = 10; //splitting array in chunks $cols = array_chunk($que_nos,$part); echo '<table border="1" cellpadding="5">'; echo '<tr>'; foreach($cols as $col) { //Generating heading columns echo "<td>Q</td>"; echo "<td>Tally</td>"; echo "<td>Total</td>"; } echo '</tr>'; //data for each row $row_data = []; for ($i=0; $i < $part; $i++) { //temporary variable containing values for each row $temp_row_data = []; foreach($cols as $k1 => $col) { //getting first value of array $value = reset($col); $temp_row_data[] = $value ?: ''; if ($value !== false) { //unset value as it is already processed unset($cols[$k1][array_search($value,$col)]); } } //storing temporary array in main row array $row_data[] = $temp_row_data; } foreach ($row_data as $key => $cd) { echo '<tr>'; foreach ($cd as $c) { echo "<td>{$c}</td>"; echo "<td></td>"; echo "<td></td>"; } echo '</tr>'; } echo '</table>';
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 21
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 21
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 51
Branch analysis from position: 51
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 26
Branch analysis from position: 53
2 jumps found. (Code = 77) Position 1 = 54, Position 2 = 69
Branch analysis from position: 54
2 jumps found. (Code = 78) Position 1 = 55, Position 2 = 69
Branch analysis from position: 55
2 jumps found. (Code = 77) Position 1 = 58, Position 2 = 66
Branch analysis from position: 58
2 jumps found. (Code = 78) Position 1 = 59, Position 2 = 66
Branch analysis from position: 59
1 jumps found. (Code = 42) Position 1 = 58
Branch analysis from position: 58
Branch analysis from position: 66
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
Branch analysis from position: 66
Branch analysis from position: 69
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 69
Branch analysis from position: 26
2 jumps found. (Code = 77) Position 1 = 28, Position 2 = 47
Branch analysis from position: 28
2 jumps found. (Code = 78) Position 1 = 29, Position 2 = 47
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 46
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
Branch analysis from position: 46
Branch analysis from position: 47
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 26
Branch analysis from position: 53
Branch analysis from position: 26
Branch analysis from position: 47
Branch analysis from position: 21
filename:       /in/bmXmt
function name:  (null)
number of ops:  72
compiled vars:  !0 = $total_ques, !1 = $que_nos, !2 = $part, !3 = $cols, !4 = $col, !5 = $row_data, !6 = $i, !7 = $temp_row_data, !8 = $k1, !9 = $value, !10 = $cd, !11 = $key, !12 = $c
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                       !0, 45
    6     1        INIT_FCALL                                                   'range'
          2        SEND_VAL                                                     1
          3        CAST                                              4  ~14     !0
          4        SEND_VAL                                                     ~14
          5        DO_ICALL                                             $15     
          6        ASSIGN                                                       !1, $15
    7     7        ASSIGN                                                       !2, 10
   10     8        INIT_FCALL                                                   'array_chunk'
          9        SEND_VAR                                                     !1
         10        SEND_VAR                                                     !2
         11        DO_ICALL                                             $18     
         12        ASSIGN                                                       !3, $18
   12    13        ECHO                                                         '%3Ctable+border%3D%221%22+cellpadding%3D%225%22%3E'
   13    14        ECHO                                                         '%3Ctr%3E'
   14    15      > FE_RESET_R                                           $20     !3, ->21
         16    > > FE_FETCH_R                                                   $20, !4, ->21
   16    17    >   ECHO                                                         '%3Ctd%3EQ%3C%2Ftd%3E'
   17    18        ECHO                                                         '%3Ctd%3ETally%3C%2Ftd%3E'
   18    19        ECHO                                                         '%3Ctd%3ETotal%3C%2Ftd%3E'
   14    20      > JMP                                                          ->16
         21    >   FE_FREE                                                      $20
   20    22        ECHO                                                         '%3C%2Ftr%3E'
   23    23        ASSIGN                                                       !5, <array>
   24    24        ASSIGN                                                       !6, 0
         25      > JMP                                                          ->51
   26    26    >   ASSIGN                                                       !7, <array>
   27    27      > FE_RESET_R                                           $24     !3, ->47
         28    > > FE_FETCH_R                                           ~25     $24, !4, ->47
         29    >   ASSIGN                                                       !8, ~25
   29    30        INIT_FCALL                                                   'reset'
         31        SEND_REF                                                     !4
         32        DO_ICALL                                             $27     
         33        ASSIGN                                                       !9, $27
   30    34        JMP_SET                                              ~30     !9, ->36
         35        QM_ASSIGN                                            ~30     ''
         36        ASSIGN_DIM                                                   !7
         37        OP_DATA                                                      ~30
   31    38        TYPE_CHECK                                      1018          !9
         39      > JMPZ                                                         ~31, ->46
   33    40    >   INIT_FCALL                                                   'array_search'
         41        SEND_VAR                                                     !9
         42        SEND_VAR                                                     !4
         43        DO_ICALL                                             $33     
         44        FETCH_DIM_UNSET                                      $32     !3, !8
         45        UNSET_DIM                                                    $32, $33
   27    46    > > JMP                                                          ->28
         47    >   FE_FREE                                                      $24
   37    48        ASSIGN_DIM                                                   !5
         49        OP_DATA                                                      !7
   24    50        PRE_INC                                                      !6
         51    >   IS_SMALLER                                                   !6, !2
         52      > JMPNZ                                                        ~36, ->26
   40    53    > > FE_RESET_R                                           $37     !5, ->69
         54    > > FE_FETCH_R                                           ~38     $37, !10, ->69
         55    >   ASSIGN                                                       !11, ~38
   41    56        ECHO                                                         '%3Ctr%3E'
   42    57      > FE_RESET_R                                           $40     !10, ->66
         58    > > FE_FETCH_R                                                   $40, !12, ->66
   43    59    >   ROPE_INIT                                         3  ~42     '%3Ctd%3E'
         60        ROPE_ADD                                          1  ~42     ~42, !12
         61        ROPE_END                                          2  ~41     ~42, '%3C%2Ftd%3E'
         62        ECHO                                                         ~41
   44    63        ECHO                                                         '%3Ctd%3E%3C%2Ftd%3E'
   45    64        ECHO                                                         '%3Ctd%3E%3C%2Ftd%3E'
   42    65      > JMP                                                          ->58
         66    >   FE_FREE                                                      $40
   47    67        ECHO                                                         '%3C%2Ftr%3E'
   40    68      > JMP                                                          ->54
         69    >   FE_FREE                                                      $37
   50    70        ECHO                                                         '%3C%2Ftable%3E'
         71      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.46 ms | 3141 KiB | 17 Q