3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.78 ms | 1385 KiB | 13 Q