3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr = array(); for ($i=0; $i<10; $i++) { $arr[] = new stdClass(); } $it = new ArrayIterator($arr); $i = 1; foreach ($it as $obj) { $obj->test = $i; $i++; } var_dump(current($it));
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 = 10, Position 2 = 3
Branch analysis from position: 10
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 21
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 21
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
Branch analysis from position: 3
filename:       /in/JfnT3
function name:  (null)
number of ops:  29
compiled vars:  !0 = $arr, !1 = $i, !2 = $it, !3 = $obj
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        ASSIGN                                                       !1, 0
          2      > JMP                                                          ->8
    6     3    >   NEW                                                  $7      'stdClass'
          4        DO_FCALL                                          0          
          5        ASSIGN_DIM                                                   !0
          6        OP_DATA                                                      $7
    4     7        PRE_INC                                                      !1
          8    >   IS_SMALLER                                                   !1, 10
          9      > JMPNZ                                                        ~10, ->3
    9    10    >   NEW                                                  $11     'ArrayIterator'
         11        SEND_VAR_EX                                                  !0
         12        DO_FCALL                                          0          
         13        ASSIGN                                                       !2, $11
   11    14        ASSIGN                                                       !1, 1
   12    15      > FE_RESET_R                                           $15     !2, ->21
         16    > > FE_FETCH_R                                                   $15, !3, ->21
   14    17    >   ASSIGN_OBJ                                                   !3, 'test'
         18        OP_DATA                                                      !1
   15    19        PRE_INC                                                      !1
   12    20      > JMP                                                          ->16
         21    >   FE_FREE                                                      $15
   18    22        INIT_FCALL                                                   'var_dump'
         23        INIT_FCALL                                                   'current'
         24        SEND_VAR                                                     !2
         25        DO_ICALL                                             $18     
         26        SEND_VAR                                                     $18
         27        DO_ICALL                                                     
         28      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
177.44 ms | 3323 KiB | 15 Q