3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = new ArrayObject(array(1, 2)); $it = $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 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 8
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 30
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 8
Branch analysis from position: 18
Branch analysis from position: 8
filename:       /in/VnB5L
function name:  (null)
number of ops:  33
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        INIT_METHOD_CALL                                         !0, 'getIterator'
          5        DO_FCALL                                      0  $6      
          6        ASSIGN                                                   !1, $6
    7     7      > JMP                                                      ->15
    9     8    >   INIT_METHOD_CALL                                         !1, 'current'
          9        DO_FCALL                                      0  $8      
         10        ECHO                                                     $8
   10    11        CLONE                                            ~9      !1
         12        ASSIGN                                                   !2, ~9
   11    13        INIT_METHOD_CALL                                         !1, 'next'
         14        DO_FCALL                                      0          
    7    15    >   INIT_METHOD_CALL                                         !1, 'valid'
         16        DO_FCALL                                      0  $12     
         17      > JMPNZ                                                    $12, ->8
   14    18    >   ASSIGN_DIM                                               !0
         19        OP_DATA                                                  3
   16    20        ASSIGN                                                   !1, !2
   17    21        INIT_METHOD_CALL                                         !2, 'next'
         22        DO_FCALL                                      0          
   18    23        INIT_METHOD_CALL                                         !1, 'valid'
         24        DO_FCALL                                      0  $16     
         25      > JMPZ                                                     $16, ->30
         26    >   INIT_METHOD_CALL                                         !1, 'current'
         27        DO_FCALL                                      0  $17     
         28        QM_ASSIGN                                        ~18     $17
         29      > JMP                                                      ->31
         30    >   QM_ASSIGN                                        ~18     'not+valid'
         31    >   ECHO                                                     ~18
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.05 ms | 1395 KiB | 13 Q