3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = array(0 => 1, 2 => 3, 4 => 5, 6 => 7, 8 => 9); foreach (array_keys($x) as $key => $value) { echo $key . "->". $value."\n"; } echo next($x)."\n"; echo next($x)."\n"; $y = $x; echo next($y)."\n"; echo next($y)."\n"; reset($y); echo next($x)."\n"; echo next($y)."\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/sXFIi
function name:  (null)
number of ops:  48
compiled vars:  !0 = $x, !1 = $value, !2 = $key, !3 = $y
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                                         $5      
          4      > FE_RESET_R                                       $6      $5, ->12
          5    > > FE_FETCH_R                                       ~7      $6, !1, ->12
          6    >   ASSIGN                                                   !2, ~7
    6     7        CONCAT                                           ~9      !2, '-%3E'
          8        CONCAT                                           ~10     ~9, !1
          9        CONCAT                                           ~11     ~10, '%0A'
         10        ECHO                                                     ~11
    5    11      > JMP                                                      ->5
         12    >   FE_FREE                                                  $6
    8    13        INIT_FCALL                                               'next'
         14        SEND_REF                                                 !0
         15        DO_ICALL                                         $12     
         16        CONCAT                                           ~13     $12, '%0A'
         17        ECHO                                                     ~13
    9    18        INIT_FCALL                                               'next'
         19        SEND_REF                                                 !0
         20        DO_ICALL                                         $14     
         21        CONCAT                                           ~15     $14, '%0A'
         22        ECHO                                                     ~15
   10    23        ASSIGN                                                   !3, !0
   11    24        INIT_FCALL                                               'next'
         25        SEND_REF                                                 !3
         26        DO_ICALL                                         $17     
         27        CONCAT                                           ~18     $17, '%0A'
         28        ECHO                                                     ~18
   12    29        INIT_FCALL                                               'next'
         30        SEND_REF                                                 !3
         31        DO_ICALL                                         $19     
         32        CONCAT                                           ~20     $19, '%0A'
         33        ECHO                                                     ~20
   13    34        INIT_FCALL                                               'reset'
         35        SEND_REF                                                 !3
         36        DO_ICALL                                                 
   14    37        INIT_FCALL                                               'next'
         38        SEND_REF                                                 !0
         39        DO_ICALL                                         $22     
         40        CONCAT                                           ~23     $22, '%0A'
         41        ECHO                                                     ~23
   15    42        INIT_FCALL                                               'next'
         43        SEND_REF                                                 !3
         44        DO_ICALL                                         $24     
         45        CONCAT                                           ~25     $24, '%0A'
         46        ECHO                                                     ~25
         47      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.71 ms | 1400 KiB | 19 Q