3v4l.org

run code in 300+ PHP versions simultaneously
<?php $it1 = new ArrayIterator(array(1,2,3)); $it2 = new ArrayIterator(array(4,5,6)); $multipleIterator = new MultipleIterator(); $multipleIterator->attachIterator($it1); $multipleIterator->attachIterator($it2, 'second'); foreach ($multipleIterator as $key => $value) { echo "Key\n"; var_dump($key); echo "Value\n"; var_dump($value); echo "---next---\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 31
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 31
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/3m8Vo
function name:  (null)
number of ops:  33
compiled vars:  !0 = $it1, !1 = $it2, !2 = $multipleIterator, !3 = $value, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $5      'ArrayIterator'
          1        SEND_VAL_EX                                              <array>
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $5
    4     4        NEW                                              $8      'ArrayIterator'
          5        SEND_VAL_EX                                              <array>
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $8
    6     8        NEW                                              $11     'MultipleIterator'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $11
    8    11        INIT_METHOD_CALL                                         !2, 'attachIterator'
         12        SEND_VAR_EX                                              !0
         13        DO_FCALL                                      0          
    9    14        INIT_METHOD_CALL                                         !2, 'attachIterator'
         15        SEND_VAR_EX                                              !1
         16        SEND_VAL_EX                                              'second'
         17        DO_FCALL                                      0          
   11    18      > FE_RESET_R                                       $16     !2, ->31
         19    > > FE_FETCH_R                                       ~17     $16, !3, ->31
         20    >   ASSIGN                                                   !4, ~17
   12    21        ECHO                                                     'Key%0A'
         22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !4
         24        DO_ICALL                                                 
   13    25        ECHO                                                     'Value%0A'
         26        INIT_FCALL                                               'var_dump'
         27        SEND_VAR                                                 !3
         28        DO_ICALL                                                 
   14    29        ECHO                                                     '---next---%0A'
   11    30      > JMP                                                      ->19
         31    >   FE_FREE                                                  $16
   15    32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.07 ms | 1396 KiB | 15 Q