3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array ( 0 => array ( 0 => 'ABC', 1 => 'XYZ' ), 1 => array ( 1 => 'ADW', 20 => 'XYZ', 26 => 'AA2', 30 => 'PQR', 60 => 'WWW', 701 => 'ZZZ' ) ); $result = array(); foreach ($data as $rownum => $row) { foreach ($row as $colnum => $value) { if ($colnum >= 26) { $col0 = $colnum % 26; $col1 = intdiv($colnum, 26); $colstr = chr(64 + $col1) . chr(65 + $col0); } else { $colstr = chr(65+$colnum); } $result[$colstr . ($rownum+1)] = $value; } } print_r($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 40
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 40
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 38
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 38
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 28
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 38
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
filename:       /in/s2Pom
function name:  (null)
number of ops:  45
compiled vars:  !0 = $data, !1 = $result, !2 = $row, !3 = $rownum, !4 = $value, !5 = $colnum, !6 = $col0, !7 = $col1, !8 = $colstr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   20     1        ASSIGN                                                   !1, <array>
   22     2      > FE_RESET_R                                       $11     !0, ->40
          3    > > FE_FETCH_R                                       ~12     $11, !2, ->40
          4    >   ASSIGN                                                   !3, ~12
   23     5      > FE_RESET_R                                       $14     !2, ->38
          6    > > FE_FETCH_R                                       ~15     $14, !4, ->38
          7    >   ASSIGN                                                   !5, ~15
   24     8        IS_SMALLER_OR_EQUAL                                      26, !5
          9      > JMPZ                                                     ~17, ->28
   25    10    >   MOD                                              ~18     !5, 26
         11        ASSIGN                                                   !6, ~18
   26    12        INIT_FCALL                                               'intdiv'
         13        SEND_VAR                                                 !5
         14        SEND_VAL                                                 26
         15        DO_ICALL                                         $20     
         16        ASSIGN                                                   !7, $20
   27    17        INIT_FCALL                                               'chr'
         18        ADD                                              ~22     64, !7
         19        SEND_VAL                                                 ~22
         20        DO_ICALL                                         $23     
         21        INIT_FCALL                                               'chr'
         22        ADD                                              ~24     65, !6
         23        SEND_VAL                                                 ~24
         24        DO_ICALL                                         $25     
         25        CONCAT                                           ~26     $23, $25
         26        ASSIGN                                                   !8, ~26
   24    27      > JMP                                                      ->33
   30    28    >   INIT_FCALL                                               'chr'
         29        ADD                                              ~28     65, !5
         30        SEND_VAL                                                 ~28
         31        DO_ICALL                                         $29     
         32        ASSIGN                                                   !8, $29
   32    33    >   ADD                                              ~31     !3, 1
         34        CONCAT                                           ~32     !8, ~31
         35        ASSIGN_DIM                                               !1, ~32
         36        OP_DATA                                                  !4
   23    37      > JMP                                                      ->6
         38    >   FE_FREE                                                  $14
   22    39      > JMP                                                      ->3
         40    >   FE_FREE                                                  $11
   36    41        INIT_FCALL                                               'print_r'
         42        SEND_VAR                                                 !1
         43        DO_ICALL                                                 
         44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.33 ms | 1007 KiB | 16 Q