3v4l.org

run code in 300+ PHP versions simultaneously
<?php $i = 0; // menghitung loop $j = 0; // key untuk $data $contoh = range(0, 11); $temp = []; $data = []; foreach($contoh as $c) { $temp[$i] = $c; $i++; if( ($i % 3) == 0) { $data[] = $temp[$i - 1]; } } print_r($temp); print_r($data);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 22
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 22
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 21
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 21
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/2lLVP
function name:  (null)
number of ops:  30
compiled vars:  !0 = $i, !1 = $j, !2 = $contoh, !3 = $temp, !4 = $data, !5 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 0
    4     1        ASSIGN                                                   !1, 0
    5     2        INIT_FCALL                                               'range'
          3        SEND_VAL                                                 0
          4        SEND_VAL                                                 11
          5        DO_ICALL                                         $8      
          6        ASSIGN                                                   !2, $8
    6     7        ASSIGN                                                   !3, <array>
    7     8        ASSIGN                                                   !4, <array>
    9     9      > FE_RESET_R                                       $12     !2, ->22
         10    > > FE_FETCH_R                                               $12, !5, ->22
   11    11    >   ASSIGN_DIM                                               !3, !0
         12        OP_DATA                                                  !5
   12    13        PRE_INC                                                  !0
   14    14        MOD                                              ~15     !0, 3
         15        IS_EQUAL                                                 ~15, 0
         16      > JMPZ                                                     ~16, ->21
   15    17    >   SUB                                              ~18     !0, 1
         18        FETCH_DIM_R                                      ~19     !3, ~18
         19        ASSIGN_DIM                                               !4
         20        OP_DATA                                                  ~19
    9    21    > > JMP                                                      ->10
         22    >   FE_FREE                                                  $12
   20    23        INIT_FCALL                                               'print_r'
         24        SEND_VAR                                                 !3
         25        DO_ICALL                                                 
   21    26        INIT_FCALL                                               'print_r'
         27        SEND_VAR                                                 !4
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.87 ms | 1396 KiB | 17 Q