3v4l.org

run code in 300+ PHP versions simultaneously
<?php $linearray = [['a','z',1], ['a','z',0], ['a','b',1], ['a','c',1]]; $a_iter = new ArrayIterator($linearray); $b_iter = new LimitIterator(new InfiniteIterator(new ArrayIterator(array("1","2","3","4","5","6"))), 0, count($linearray)); $m_iter = new MultipleIterator(MultipleIterator::MIT_KEYS_ASSOC); $m_iter->attachIterator($a_iter, 'a'); $m_iter->attachIterator($b_iter, 'b'); foreach ($m_iter as $item) { print_r(array_merge($item['a'], array($item['b']))); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 31, Position 2 = 43
Branch analysis from position: 31
2 jumps found. (Code = 78) Position 1 = 32, Position 2 = 43
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
filename:       /in/bhJPo
function name:  (null)
number of ops:  45
compiled vars:  !0 = $linearray, !1 = $a_iter, !2 = $b_iter, !3 = $m_iter, !4 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        NEW                                              $6      'ArrayIterator'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $6
    7     5        NEW                                              $9      'LimitIterator'
          6        NEW                                              $10     'InfiniteIterator'
          7        NEW                                              $11     'ArrayIterator'
          8        SEND_VAL_EX                                              <array>
          9        DO_FCALL                                      0          
         10        SEND_VAR_NO_REF_EX                                       $11
         11        DO_FCALL                                      0          
         12        SEND_VAR_NO_REF_EX                                       $10
         13        SEND_VAL_EX                                              0
         14        COUNT                                            ~14     !0
         15        SEND_VAL_EX                                              ~14
         16        DO_FCALL                                      0          
         17        ASSIGN                                                   !2, $9
    9    18        NEW                                              $17     'MultipleIterator'
         19        SEND_VAL_EX                                              2
         20        DO_FCALL                                      0          
         21        ASSIGN                                                   !3, $17
   10    22        INIT_METHOD_CALL                                         !3, 'attachIterator'
         23        SEND_VAR_EX                                              !1
         24        SEND_VAL_EX                                              'a'
         25        DO_FCALL                                      0          
   11    26        INIT_METHOD_CALL                                         !3, 'attachIterator'
         27        SEND_VAR_EX                                              !2
         28        SEND_VAL_EX                                              'b'
         29        DO_FCALL                                      0          
   13    30      > FE_RESET_R                                       $22     !3, ->43
         31    > > FE_FETCH_R                                               $22, !4, ->43
   14    32    >   INIT_FCALL                                               'print_r'
         33        INIT_FCALL                                               'array_merge'
         34        FETCH_DIM_R                                      ~23     !4, 'a'
         35        SEND_VAL                                                 ~23
         36        FETCH_DIM_R                                      ~24     !4, 'b'
         37        INIT_ARRAY                                       ~25     ~24
         38        SEND_VAL                                                 ~25
         39        DO_ICALL                                         $26     
         40        SEND_VAR                                                 $26
         41        DO_ICALL                                                 
   13    42      > JMP                                                      ->31
         43    >   FE_FREE                                                  $22
   15    44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.49 ms | 1392 KiB | 17 Q