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(); $it->next(); } $array[] = 3; echo $it->valid() ? $it->current : "not valid";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 9
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 25
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 9
Branch analysis from position: 17
Branch analysis from position: 9
filename:       /in/OX0iA
function name:  (null)
number of ops:  28
compiled vars:  !0 = $array, !1 = $it
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $2      'ArrayObject'
          1        SEND_VAL_EX                                              <array>
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
    5     4        NEW                                              $5      'ArrayIterator'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
    7     8      > JMP                                                      ->14
    9     9    >   INIT_METHOD_CALL                                         !1, 'current'
         10        DO_FCALL                                      0  $8      
         11        ECHO                                                     $8
   10    12        INIT_METHOD_CALL                                         !1, 'next'
         13        DO_FCALL                                      0          
    7    14    >   INIT_METHOD_CALL                                         !1, 'valid'
         15        DO_FCALL                                      0  $10     
         16      > JMPNZ                                                    $10, ->9
   13    17    >   ASSIGN_DIM                                               !0
         18        OP_DATA                                                  3
   15    19        INIT_METHOD_CALL                                         !1, 'valid'
         20        DO_FCALL                                      0  $12     
         21      > JMPZ                                                     $12, ->25
         22    >   FETCH_OBJ_R                                      ~13     !1, 'current'
         23        QM_ASSIGN                                        ~14     ~13
         24      > JMP                                                      ->26
         25    >   QM_ASSIGN                                        ~14     'not+valid'
         26    >   ECHO                                                     ~14
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.01 ms | 1395 KiB | 13 Q