3v4l.org

run code in 300+ PHP versions simultaneously
<?php // nice case of value after looping $a = array("one"=>1,"two"=>2,"three"=>3); echo "-----\nPointer\n-----\n"; foreach($a as &$b) { var_dump( key($a) ); var_dump( current($a) ); } echo "-----\nAfter iteration\n-----\n"; var_dump( key($a) ); var_dump( current($a) ); echo "-----\nNo pointer\n-----\n"; foreach($a as $b) { var_dump( key($a) ); var_dump( current($a) ); } echo "-----\nAfter iteration\n-----\n"; var_dump( key($a) ); var_dump( current($a) );
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
2 jumps found. (Code = 126) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 17
2 jumps found. (Code = 77) Position 1 = 33, Position 2 = 47
Branch analysis from position: 33
2 jumps found. (Code = 78) Position 1 = 34, Position 2 = 47
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
Branch analysis from position: 17
filename:       /in/pn0Qn
function name:  (null)
number of ops:  62
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, <array>
    7     1        ECHO                                                     '-----%0APointer%0A-----%0A'
    9     2      > FE_RESET_RW                                      $3      !0, ->17
          3    > > FE_FETCH_RW                                              $3, !1, ->17
   11     4    >   INIT_FCALL                                               'var_dump'
          5        INIT_FCALL                                               'key'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                                 
   12    10        INIT_FCALL                                               'var_dump'
         11        INIT_FCALL                                               'current'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $6      
         14        SEND_VAR                                                 $6
         15        DO_ICALL                                                 
    9    16      > JMP                                                      ->3
         17    >   FE_FREE                                                  $3
   16    18        ECHO                                                     '-----%0AAfter+iteration%0A-----%0A'
   19    19        INIT_FCALL                                               'var_dump'
         20        INIT_FCALL                                               'key'
         21        SEND_VAR                                                 !0
         22        DO_ICALL                                         $8      
         23        SEND_VAR                                                 $8
         24        DO_ICALL                                                 
   20    25        INIT_FCALL                                               'var_dump'
         26        INIT_FCALL                                               'current'
         27        SEND_VAR                                                 !0
         28        DO_ICALL                                         $10     
         29        SEND_VAR                                                 $10
         30        DO_ICALL                                                 
   22    31        ECHO                                                     '-----%0ANo+pointer%0A-----%0A'
   24    32      > FE_RESET_R                                       $12     !0, ->47
         33    > > FE_FETCH_R                                               $12, !1, ->47
   26    34    >   INIT_FCALL                                               'var_dump'
         35        INIT_FCALL                                               'key'
         36        SEND_VAR                                                 !0
         37        DO_ICALL                                         $13     
         38        SEND_VAR                                                 $13
         39        DO_ICALL                                                 
   27    40        INIT_FCALL                                               'var_dump'
         41        INIT_FCALL                                               'current'
         42        SEND_VAR                                                 !0
         43        DO_ICALL                                         $15     
         44        SEND_VAR                                                 $15
         45        DO_ICALL                                                 
   24    46      > JMP                                                      ->33
         47    >   FE_FREE                                                  $12
   30    48        ECHO                                                     '-----%0AAfter+iteration%0A-----%0A'
   32    49        INIT_FCALL                                               'var_dump'
         50        INIT_FCALL                                               'key'
         51        SEND_VAR                                                 !0
         52        DO_ICALL                                         $17     
         53        SEND_VAR                                                 $17
         54        DO_ICALL                                                 
   33    55        INIT_FCALL                                               'var_dump'
         56        INIT_FCALL                                               'current'
         57        SEND_VAR                                                 !0
         58        DO_ICALL                                         $19     
         59        SEND_VAR                                                 $19
         60        DO_ICALL                                                 
         61      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.75 ms | 1400 KiB | 19 Q