3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = ["a", "b", "c", "d", "e", "f"]; foreach($arr as $k => $v) $arr[$k] = ["current" => $v, "next" => ""]; foreach($arr as $k => $v) { if(isset($arr[$k+1])) $arr[$k]["next"] = &$arr[$k+1]["current"]; else $arr[$k]["next"] = ""; } print_r($arr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 9
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 9
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 28
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 28
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 24
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
Branch analysis from position: 9
filename:       /in/a0rtA
function name:  (null)
number of ops:  33
compiled vars:  !0 = $arr, !1 = $v, !2 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1      > FE_RESET_R                                       $4      !0, ->9
          2    > > FE_FETCH_R                                       ~5      $4, !1, ->9
          3    >   ASSIGN                                                   !2, ~5
    6     4        INIT_ARRAY                                       ~8      !1, 'current'
          5        ADD_ARRAY_ELEMENT                                ~8      '', 'next'
          6        ASSIGN_DIM                                               !0, !2
          7        OP_DATA                                                  ~8
    5     8      > JMP                                                      ->2
          9    >   FE_FREE                                                  $4
    8    10      > FE_RESET_R                                       $9      !0, ->28
         11    > > FE_FETCH_R                                       ~10     $9, !1, ->28
         12    >   ASSIGN                                                   !2, ~10
    9    13        ADD                                              ~12     !2, 1
         14        ISSET_ISEMPTY_DIM_OBJ                         0          !0, ~12
         15      > JMPZ                                                     ~13, ->24
   10    16    >   ADD                                              ~16     !2, 1
         17        FETCH_DIM_W                                      $17     !0, ~16
         18        FETCH_DIM_W                                      $18     $17, 'current'
         19        MAKE_REF                                         $19     $18
         20        FETCH_DIM_W                                      $14     !0, !2
         21        FETCH_DIM_W                                      $15     $14, 'next'
         22        ASSIGN_REF                                               $15, $19
         23      > JMP                                                      ->27
   12    24    >   FETCH_DIM_W                                      $21     !0, !2
         25        ASSIGN_DIM                                               $21, 'next'
         26        OP_DATA                                                  ''
    8    27    > > JMP                                                      ->11
         28    >   FE_FREE                                                  $9
   15    29        INIT_FCALL                                               'print_r'
         30        SEND_VAR                                                 !0
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.64 ms | 1404 KiB | 15 Q