3v4l.org

run code in 300+ PHP versions simultaneously
<?php $labels = [ ["EY>Yes","Media Type>Category B","Coverage Type>Quote","Industry Programs>Communications","Score>1"], ["EY>No","Media Type>Category B2","Coverage Type>Quote2","Industry Programs>Communications2","Score>2"], ]; $i = 0; foreach($labels[0] as $ind=>$label){ $letter = range('A', 'Z')[$ind]; $tmp = explode('>',$label); $col_names[] = $tmp[0]; echo $letter.'1'."\r\n"; //$objPHPExcel->getActiveSheet()->setCellValue($letter.'1',$tmp[0]); echo "Column -> $tmp[0] \r\n"; } echo "\r\n\r\n"; // print_r($col_names); // column names /* ( [0] => EY [1] => Media Type [2] => Coverage Type [3] => Industry Programs [4] => Score ) */ foreach ($labels as $ind=>$item){ $index = $ind + 2; foreach($item as $ind2=>$data){ $letter = range('A', 'Z')[$ind2]; echo "$letter$index \r\n"; $val = explode('>',$data); //$objPHPExcel->getActiveSheet()->setCellValue("$letter$index",$val[1]); echo "Value at $index -> $val[1] \r\n\r\n"; } echo "\r\n\r\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 29
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 29
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 29
2 jumps found. (Code = 77) Position 1 = 32, Position 2 = 65
Branch analysis from position: 32
2 jumps found. (Code = 78) Position 1 = 33, Position 2 = 65
Branch analysis from position: 33
2 jumps found. (Code = 77) Position 1 = 37, Position 2 = 62
Branch analysis from position: 37
2 jumps found. (Code = 78) Position 1 = 38, Position 2 = 62
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
Branch analysis from position: 62
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
Branch analysis from position: 62
Branch analysis from position: 65
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 65
Branch analysis from position: 29
filename:       /in/Itvnr
function name:  (null)
number of ops:  67
compiled vars:  !0 = $labels, !1 = $i, !2 = $label, !3 = $ind, !4 = $letter, !5 = $tmp, !6 = $col_names, !7 = $item, !8 = $index, !9 = $data, !10 = $ind2, !11 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    7     1        ASSIGN                                                   !1, 0
    9     2        FETCH_DIM_R                                      ~14     !0, 0
          3      > FE_RESET_R                                       $15     ~14, ->29
          4    > > FE_FETCH_R                                       ~16     $15, !2, ->29
          5    >   ASSIGN                                                   !3, ~16
   11     6        INIT_FCALL                                               'range'
          7        SEND_VAL                                                 'A'
          8        SEND_VAL                                                 'Z'
          9        DO_ICALL                                         $18     
         10        FETCH_DIM_R                                      ~19     $18, !3
         11        ASSIGN                                                   !4, ~19
   12    12        INIT_FCALL                                               'explode'
         13        SEND_VAL                                                 '%3E'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                         $21     
         16        ASSIGN                                                   !5, $21
   13    17        FETCH_DIM_R                                      ~24     !5, 0
         18        ASSIGN_DIM                                               !6
         19        OP_DATA                                                  ~24
   14    20        CONCAT                                           ~25     !4, '1'
         21        CONCAT                                           ~26     ~25, '%0D%0A'
         22        ECHO                                                     ~26
   16    23        ROPE_INIT                                     3  ~29     'Column+-%3E+'
         24        FETCH_DIM_R                                      ~27     !5, 0
         25        ROPE_ADD                                      1  ~29     ~29, ~27
         26        ROPE_END                                      2  ~28     ~29, '+%0D%0A'
         27        ECHO                                                     ~28
    9    28      > JMP                                                      ->4
         29    >   FE_FREE                                                  $15
   18    30        ECHO                                                     '%0D%0A%0D%0A'
   32    31      > FE_RESET_R                                       $31     !0, ->65
         32    > > FE_FETCH_R                                       ~32     $31, !7, ->65
         33    >   ASSIGN                                                   !3, ~32
   34    34        ADD                                              ~34     !3, 2
         35        ASSIGN                                                   !8, ~34
   36    36      > FE_RESET_R                                       $36     !7, ->62
         37    > > FE_FETCH_R                                       ~37     $36, !9, ->62
         38    >   ASSIGN                                                   !10, ~37
   38    39        INIT_FCALL                                               'range'
         40        SEND_VAL                                                 'A'
         41        SEND_VAL                                                 'Z'
         42        DO_ICALL                                         $39     
         43        FETCH_DIM_R                                      ~40     $39, !10
         44        ASSIGN                                                   !4, ~40
   40    45        ROPE_INIT                                     3  ~43     !4
         46        ROPE_ADD                                      1  ~43     ~43, !8
         47        ROPE_END                                      2  ~42     ~43, '+%0D%0A'
         48        ECHO                                                     ~42
   42    49        INIT_FCALL                                               'explode'
         50        SEND_VAL                                                 '%3E'
         51        SEND_VAR                                                 !9
         52        DO_ICALL                                         $45     
         53        ASSIGN                                                   !11, $45
   45    54        ROPE_INIT                                     5  ~49     'Value+at+'
         55        ROPE_ADD                                      1  ~49     ~49, !8
         56        ROPE_ADD                                      2  ~49     ~49, '+-%3E+'
         57        FETCH_DIM_R                                      ~47     !11, 1
         58        ROPE_ADD                                      3  ~49     ~49, ~47
         59        ROPE_END                                      4  ~48     ~49, '+%0D%0A%0D%0A'
         60        ECHO                                                     ~48
   36    61      > JMP                                                      ->37
         62    >   FE_FREE                                                  $36
   47    63        ECHO                                                     '%0D%0A%0D%0A'
   32    64      > JMP                                                      ->32
         65    >   FE_FREE                                                  $31
   48    66      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.92 ms | 1008 KiB | 15 Q