3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.29 ms | 1395 KiB | 13 Q