3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.82 ms | 1395 KiB | 13 Q