3v4l.org

run code in 300+ PHP versions simultaneously
<?php $campaignIds = array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17); $limit=3; $blocksCount = ceil(count($campaignIds) / $limit);echo $blocksCount.PHP_EOL; for ($i = 0; $i < $blocksCount; $i++) {echo $i.' - '. $blocksCount * $i .PHP_EOL; print_r((array_slice($campaignIds, $blocksCount * $i, $limit))); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 12
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 12
Branch analysis from position: 29
Branch analysis from position: 12
filename:       /in/0NBUF
function name:  (null)
number of ops:  30
compiled vars:  !0 = $campaignIds, !1 = $limit, !2 = $blocksCount, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, 3
    5     2        INIT_FCALL                                               'ceil'
          3        COUNT                                            ~6      !0
          4        DIV                                              ~7      ~6, !1
          5        SEND_VAL                                                 ~7
          6        DO_ICALL                                         $8      
          7        ASSIGN                                                   !2, $8
          8        CONCAT                                           ~10     !2, '%0A'
          9        ECHO                                                     ~10
    6    10        ASSIGN                                                   !3, 0
         11      > JMP                                                      ->27
         12    >   CONCAT                                           ~12     !3, '+-+'
         13        MUL                                              ~13     !2, !3
         14        CONCAT                                           ~14     ~12, ~13
         15        CONCAT                                           ~15     ~14, '%0A'
         16        ECHO                                                     ~15
    7    17        INIT_FCALL                                               'print_r'
         18        INIT_FCALL                                               'array_slice'
         19        SEND_VAR                                                 !0
         20        MUL                                              ~16     !2, !3
         21        SEND_VAL                                                 ~16
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                         $17     
         24        SEND_VAR                                                 $17
         25        DO_ICALL                                                 
    6    26        PRE_INC                                                  !3
         27    >   IS_SMALLER                                               !3, !2
         28      > JMPNZ                                                    ~20, ->12
    8    29    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.09 ms | 1396 KiB | 19 Q