3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array(0, 1, 2); while (each($array)) { var_dump(key($array)); } reset($array); echo "----\n"; foreach ($array as $elem) { var_dump(key($array)); } reset($array); echo "----\n"; $array2 = &$array; foreach ($array2 as $elem) { var_dump(key($array)); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 2
Branch analysis from position: 12
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 25
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 25
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 25
2 jumps found. (Code = 77) Position 1 = 32, Position 2 = 40
Branch analysis from position: 32
2 jumps found. (Code = 78) Position 1 = 33, Position 2 = 40
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
Branch analysis from position: 25
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 2
Branch analysis from position: 12
Branch analysis from position: 2
filename:       /in/QtCPZ
function name:  (null)
number of ops:  42
compiled vars:  !0 = $array, !1 = $elem, !2 = $array2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1      > JMP                                                      ->8
    4     2    >   INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'key'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
    3     8    >   INIT_FCALL_BY_NAME                                       'each'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0  $6      
         11      > JMPNZ                                                    $6, ->2
    7    12    >   INIT_FCALL                                               'reset'
         13        SEND_REF                                                 !0
         14        DO_ICALL                                                 
    8    15        ECHO                                                     '----%0A'
   10    16      > FE_RESET_R                                       $8      !0, ->25
         17    > > FE_FETCH_R                                               $8, !1, ->25
   11    18    >   INIT_FCALL                                               'var_dump'
         19        INIT_FCALL                                               'key'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                         $9      
         22        SEND_VAR                                                 $9
         23        DO_ICALL                                                 
   10    24      > JMP                                                      ->17
         25    >   FE_FREE                                                  $8
   14    26        INIT_FCALL                                               'reset'
         27        SEND_REF                                                 !0
         28        DO_ICALL                                                 
   15    29        ECHO                                                     '----%0A'
   17    30        ASSIGN_REF                                               !2, !0
   18    31      > FE_RESET_R                                       $13     !2, ->40
         32    > > FE_FETCH_R                                               $13, !1, ->40
   19    33    >   INIT_FCALL                                               'var_dump'
         34        INIT_FCALL                                               'key'
         35        SEND_VAR                                                 !0
         36        DO_ICALL                                         $14     
         37        SEND_VAR                                                 $14
         38        DO_ICALL                                                 
   18    39      > JMP                                                      ->32
         40    >   FE_FREE                                                  $13
   20    41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.42 ms | 1392 KiB | 22 Q