3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = new ArrayObject(array(1, 2)); $it = new $array->getIterator(); while ($it->valid()) { echo $it->current(); $prev = clone $it; $it->next(); } $array[] = 3; $it = $prev; $prev->next(); echo $it->valid() ? $it->current() : "not valid";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 10
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 32
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 10
Branch analysis from position: 20
Branch analysis from position: 10
filename:       /in/IdqG0
function name:  (null)
number of ops:  35
compiled vars:  !0 = $array, !1 = $it, !2 = $prev
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $3      'ArrayObject'
          1        SEND_VAL_EX                                              <array>
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
    5     4        FETCH_OBJ_R                                      ~6      !0, 'getIterator'
          5        FETCH_CLASS                                   0  $7      ~6
          6        NEW                                              $8      $7
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $8
    7     9      > JMP                                                      ->17
    9    10    >   INIT_METHOD_CALL                                         !1, 'current'
         11        DO_FCALL                                      0  $11     
         12        ECHO                                                     $11
   10    13        CLONE                                            ~12     !1
         14        ASSIGN                                                   !2, ~12
   11    15        INIT_METHOD_CALL                                         !1, 'next'
         16        DO_FCALL                                      0          
    7    17    >   INIT_METHOD_CALL                                         !1, 'valid'
         18        DO_FCALL                                      0  $15     
         19      > JMPNZ                                                    $15, ->10
   14    20    >   ASSIGN_DIM                                               !0
         21        OP_DATA                                                  3
   16    22        ASSIGN                                                   !1, !2
   17    23        INIT_METHOD_CALL                                         !2, 'next'
         24        DO_FCALL                                      0          
   18    25        INIT_METHOD_CALL                                         !1, 'valid'
         26        DO_FCALL                                      0  $19     
         27      > JMPZ                                                     $19, ->32
         28    >   INIT_METHOD_CALL                                         !1, 'current'
         29        DO_FCALL                                      0  $20     
         30        QM_ASSIGN                                        ~21     $20
         31      > JMP                                                      ->33
         32    >   QM_ASSIGN                                        ~21     'not+valid'
         33    >   ECHO                                                     ~21
         34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.06 ms | 1395 KiB | 13 Q