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(0); } 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 = 22, Position 2 = 26
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
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/ZHmmb
function name:  (null)
number of ops:  29
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        INIT_METHOD_CALL                                         !0, 'getIterator'
          5        DO_FCALL                                      0  $5      
          6        ASSIGN                                                   !1, $5
    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                                              0
         14        DO_FCALL                                      0  $9      
         15        ECHO                                                     $9
    9    16    >   INIT_METHOD_CALL                                         !1, 'valid'
         17        DO_FCALL                                      0  $10     
         18      > JMPNZ                                                    $10, ->10
   16    19    >   INIT_METHOD_CALL                                         !1, 'valid'
         20        DO_FCALL                                      0  $11     
         21      > JMPZ                                                     $11, ->26
         22    >   INIT_METHOD_CALL                                         !1, 'current'
         23        DO_FCALL                                      0  $12     
         24        QM_ASSIGN                                        ~13     $12
         25      > JMP                                                      ->27
         26    >   QM_ASSIGN                                        ~13     'not+valid'
         27    >   ECHO                                                     ~13
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.5 ms | 1395 KiB | 13 Q