3v4l.org

run code in 500+ PHP versions simultaneously
<?php $input = ['A', 'B', 'C', 'D', 'E', 'F', 'G']; $cols = 2; var_export( array_map(null, ...array_chunk($input, ceil(count($input) / $cols)) ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IFZBY
function name:  (null)
number of ops:  20
compiled vars:  !0 = $input, !1 = $cols
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        ASSIGN                                                       !1, 2
    6     2        INIT_FCALL                                                   'var_export'
    7     3        INIT_FCALL                                                   'array_map'
          4        SEND_VAL                                                     null
          5        INIT_FCALL                                                   'array_chunk'
          6        SEND_VAR                                                     !0
          7        INIT_FCALL                                                   'ceil'
          8        COUNT                                                ~4      !0
          9        DIV                                                  ~5      ~4, !1
         10        SEND_VAL                                                     ~5
         11        DO_ICALL                                             $6      
         12        SEND_VAR                                                     $6
         13        DO_ICALL                                             $7      
         14        SEND_UNPACK                                                  $7
         15        CHECK_UNDEF_ARGS                                             
         16        DO_ICALL                                             $8      
         17        SEND_VAR                                                     $8
    6    18        DO_ICALL                                                     
    9    19      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.52 ms | 1894 KiB | 17 Q