3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array ('a','b','c','d'); $keys = array_keys($array); for ($i = 0; $i < count($keys); $i++) { $cur = $array[$keys[$i]]; $next = $array[$keys[$i+1]]; echo "current item: ".$cur; echo "\n"; echo "current item: ".$next; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 7
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 7
Branch analysis from position: 23
Branch analysis from position: 7
filename:       /in/0Qs9L
function name:  (null)
number of ops:  24
compiled vars:  !0 = $array, !1 = $keys, !2 = $i, !3 = $cur, !4 = $next
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'array_keys'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !1, $6
    6     5        ASSIGN                                                   !2, 0
          6      > JMP                                                      ->20
    7     7    >   FETCH_DIM_R                                      ~9      !1, !2
          8        FETCH_DIM_R                                      ~10     !0, ~9
          9        ASSIGN                                                   !3, ~10
    8    10        ADD                                              ~12     !2, 1
         11        FETCH_DIM_R                                      ~13     !1, ~12
         12        FETCH_DIM_R                                      ~14     !0, ~13
         13        ASSIGN                                                   !4, ~14
   10    14        CONCAT                                           ~16     'current+item%3A+', !3
         15        ECHO                                                     ~16
   11    16        ECHO                                                     '%0A'
   12    17        CONCAT                                           ~17     'current+item%3A+', !4
         18        ECHO                                                     ~17
    6    19        PRE_INC                                                  !2
         20    >   COUNT                                            ~19     !1
         21        IS_SMALLER                                               !2, ~19
         22      > JMPNZ                                                    ~20, ->7
   14    23    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.77 ms | 1395 KiB | 15 Q