3v4l.org

run code in 300+ PHP versions simultaneously
<?php $i = 1; $a = [1,2,$i,4,5]; $iter = new ArrayIterator($a); foreach($iter as &$v) { $v = 1; } var_dump($a); var_dump($iter);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
2 jumps found. (Code = 126) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/r6D2S
function name:  (null)
number of ops:  23
compiled vars:  !0 = $i, !1 = $a, !2 = $iter, !3 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 1
    4     1        INIT_ARRAY                                       ~5      1
          2        ADD_ARRAY_ELEMENT                                ~5      2
          3        ADD_ARRAY_ELEMENT                                ~5      !0
          4        ADD_ARRAY_ELEMENT                                ~5      4
          5        ADD_ARRAY_ELEMENT                                ~5      5
          6        ASSIGN                                                   !1, ~5
    5     7        NEW                                              $7      'ArrayIterator'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $7
    7    11      > FE_RESET_RW                                      $10     !2, ->15
         12    > > FE_FETCH_RW                                              $10, !3, ->15
    8    13    >   ASSIGN                                                   !3, 1
    7    14      > JMP                                                      ->12
         15    >   FE_FREE                                                  $10
   11    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                                 
   12    19        INIT_FCALL                                               'var_dump'
         20        SEND_VAR                                                 !2
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.13 ms | 1387 KiB | 15 Q