3v4l.org

run code in 300+ PHP versions simultaneously
<?php //16 $arr = array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p"); $limit=7; $count=ceil(count($arr)/$limit); $content = array(); $j=1; for($i=0;$i<$count;$i++) { $content[$i] = array_slice($arr,($i*$limit),($j*$limit)); //ambil array yang pertama dari setiap limit array. $tmpContent= array(); if($content[$i][0]!=$content[$i]) { $tmpContent[$i] = $content[$i]; } $content[$i] = array($content[$i][0],$tmpContent[$i]); //$content[$i][0] = array($content[$i][0]); $j++; } echo "<pre>"; var_dump(array_chunk($arr,7)); echo "</pre>";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 12
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 30
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 12
Branch analysis from position: 41
Branch analysis from position: 12
Branch analysis from position: 30
filename:       /in/s7825
function name:  (null)
number of ops:  51
compiled vars:  !0 = $arr, !1 = $limit, !2 = $count, !3 = $content, !4 = $j, !5 = $i, !6 = $tmpContent
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 7
    5     2        INIT_FCALL                                               'ceil'
          3        COUNT                                            ~9      !0
          4        DIV                                              ~10     ~9, !1
          5        SEND_VAL                                                 ~10
          6        DO_ICALL                                         $11     
          7        ASSIGN                                                   !2, $11
    6     8        ASSIGN                                                   !3, <array>
    7     9        ASSIGN                                                   !4, 1
    8    10        ASSIGN                                                   !5, 0
         11      > JMP                                                      ->39
   10    12    >   INIT_FCALL                                               'array_slice'
         13        SEND_VAR                                                 !0
         14        MUL                                              ~17     !5, !1
         15        SEND_VAL                                                 ~17
         16        MUL                                              ~18     !4, !1
         17        SEND_VAL                                                 ~18
         18        DO_ICALL                                         $19     
         19        ASSIGN_DIM                                               !3, !5
         20        OP_DATA                                                  $19
   12    21        ASSIGN                                                   !6, <array>
   14    22        FETCH_DIM_R                                      ~21     !3, !5
         23        FETCH_DIM_R                                      ~22     ~21, 0
         24        FETCH_DIM_R                                      ~23     !3, !5
         25        IS_NOT_EQUAL                                             ~22, ~23
         26      > JMPZ                                                     ~24, ->30
   16    27    >   FETCH_DIM_R                                      ~26     !3, !5
         28        ASSIGN_DIM                                               !6, !5
         29        OP_DATA                                                  ~26
   18    30    >   FETCH_DIM_R                                      ~28     !3, !5
         31        FETCH_DIM_R                                      ~29     ~28, 0
         32        INIT_ARRAY                                       ~30     ~29
         33        FETCH_DIM_R                                      ~31     !6, !5
         34        ADD_ARRAY_ELEMENT                                ~30     ~31
         35        ASSIGN_DIM                                               !3, !5
         36        OP_DATA                                                  ~30
   21    37        PRE_INC                                                  !4
    8    38        PRE_INC                                                  !5
         39    >   IS_SMALLER                                               !5, !2
         40      > JMPNZ                                                    ~34, ->12
   25    41    >   ECHO                                                     '%3Cpre%3E'
   26    42        INIT_FCALL                                               'var_dump'
         43        INIT_FCALL                                               'array_chunk'
         44        SEND_VAR                                                 !0
         45        SEND_VAL                                                 7
         46        DO_ICALL                                         $35     
         47        SEND_VAR                                                 $35
         48        DO_ICALL                                                 
   27    49        ECHO                                                     '%3C%2Fpre%3E'
         50      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.77 ms | 1400 KiB | 21 Q