3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array ( 'a' => array ( 0 => 111, 1 => 222, 2 => 333, 3 => 444, ), 'b' => array ( 0 => 555, 1 => 666, 2 => 777, 3 => 888, ), 'c' => array ( 0 => 999, 1 => 000, 2 => 111, 3 => 222, ), ); $lastRowNumber = array_key_last($data['a']); $columns = array_keys($data); for ( $rowNumber = 0; $rowNumber <= $lastRowNumber; $rowNumber++ ) { $csvRow = []; foreach ( $columns as $columnKey ) { $csvRow[] = $data[$columnKey][$rowNumber]; } echo implode(',', $csvRow), PHP_EOL; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 12
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 20
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 20
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 12
Branch analysis from position: 30
Branch analysis from position: 12
Branch analysis from position: 20
filename:       /in/P5rtU
function name:  (null)
number of ops:  31
compiled vars:  !0 = $data, !1 = $lastRowNumber, !2 = $columns, !3 = $rowNumber, !4 = $csvRow, !5 = $columnKey
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   28     1        INIT_FCALL                                               'array_key_last'
          2        FETCH_DIM_R                                      ~7      !0, 'a'
          3        SEND_VAL                                                 ~7
          4        DO_ICALL                                         $8      
          5        ASSIGN                                                   !1, $8
   29     6        INIT_FCALL                                               'array_keys'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $10     
          9        ASSIGN                                                   !2, $10
   31    10        ASSIGN                                                   !3, 0
         11      > JMP                                                      ->28
   32    12    >   ASSIGN                                                   !4, <array>
   33    13      > FE_RESET_R                                       $14     !2, ->20
         14    > > FE_FETCH_R                                               $14, !5, ->20
   34    15    >   FETCH_DIM_R                                      ~16     !0, !5
         16        FETCH_DIM_R                                      ~17     ~16, !3
         17        ASSIGN_DIM                                               !4
         18        OP_DATA                                                  ~17
   33    19      > JMP                                                      ->14
         20    >   FE_FREE                                                  $14
   36    21        INIT_FCALL                                               'implode'
         22        SEND_VAL                                                 '%2C'
         23        SEND_VAR                                                 !4
         24        DO_ICALL                                         $18     
         25        ECHO                                                     $18
         26        ECHO                                                     '%0A'
   31    27        PRE_INC                                                  !3
         28    >   IS_SMALLER_OR_EQUAL                                      !3, !1
         29      > JMPNZ                                                    ~20, ->12
   37    30    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.29 ms | 1075 KiB | 16 Q