3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = new ArrayObject(array(1, 2)); $array[] = 3; $it = $array->getIterator(); while ($it->valid()) { echo $it->current(); $prev = clone $it; $it->next(); } $it = $prev; $it->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 = 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: 10
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 10
Branch analysis from position: 20
Branch analysis from position: 10
filename:       /in/Bv10B
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        ASSIGN_DIM                                               !0
          5        OP_DATA                                                  3
    7     6        INIT_METHOD_CALL                                         !0, 'getIterator'
          7        DO_FCALL                                      0  $7      
          8        ASSIGN                                                   !1, $7
    9     9      > JMP                                                      ->17
   11    10    >   INIT_METHOD_CALL                                         !1, 'current'
         11        DO_FCALL                                      0  $9      
         12        ECHO                                                     $9
   12    13        CLONE                                            ~10     !1
         14        ASSIGN                                                   !2, ~10
   13    15        INIT_METHOD_CALL                                         !1, 'next'
         16        DO_FCALL                                      0          
    9    17    >   INIT_METHOD_CALL                                         !1, 'valid'
         18        DO_FCALL                                      0  $13     
         19      > JMPNZ                                                    $13, ->10
   16    20    >   ASSIGN                                                   !1, !2
   17    21        INIT_METHOD_CALL                                         !1, '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:
155.47 ms | 1395 KiB | 13 Q