3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array(1, 2); $it = new ArrayIterator($array); while ($it->valid()) { $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 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 6
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 19
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 6
Branch analysis from position: 11
Branch analysis from position: 6
filename:       /in/AZQ3D
function name:  (null)
number of ops:  22
compiled vars:  !0 = $array, !1 = $it
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        NEW                                              $3      'ArrayIterator'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $3
    7     5      > JMP                                                      ->8
    9     6    >   INIT_METHOD_CALL                                         !1, 'next'
          7        DO_FCALL                                      0          
    7     8    >   INIT_METHOD_CALL                                         !1, 'valid'
          9        DO_FCALL                                      0  $7      
         10      > JMPNZ                                                    $7, ->6
   12    11    >   ASSIGN_DIM                                               !0
         12        OP_DATA                                                  3
   14    13        INIT_METHOD_CALL                                         !1, 'valid'
         14        DO_FCALL                                      0  $9      
         15      > JMPZ                                                     $9, ->19
         16    >   FETCH_OBJ_R                                      ~10     !1, 'current'
         17        QM_ASSIGN                                        ~11     ~10
         18      > JMP                                                      ->20
         19    >   QM_ASSIGN                                        ~11     'not+valid'
         20    >   ECHO                                                     ~11
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.91 ms | 1398 KiB | 13 Q