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); for ($i = 0; $i < $blocksCount; $i++) {echo ($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 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 10
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 10
Branch analysis from position: 25
Branch analysis from position: 10
filename:       /in/77uSW
function name:  (null)
number of ops:  26
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
    6     8        ASSIGN                                                   !3, 0
          9      > JMP                                                      ->23
         10    >   MUL                                              ~11     !2, !3
         11        CONCAT                                           ~12     ~11, '%0A'
         12        ECHO                                                     ~12
    7    13        INIT_FCALL                                               'print_r'
         14        INIT_FCALL                                               'array_slice'
         15        SEND_VAR                                                 !0
         16        MUL                                              ~13     !2, !3
         17        SEND_VAL                                                 ~13
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                         $14     
         20        SEND_VAR                                                 $14
         21        DO_ICALL                                                 
    6    22        PRE_INC                                                  !3
         23    >   IS_SMALLER                                               !3, !2
         24      > JMPNZ                                                    ~17, ->10
    8    25    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.73 ms | 1395 KiB | 19 Q