3v4l.org

run code in 300+ PHP versions simultaneously
<?php function mkGenerator(){ for($i = 0; $i <= 10; $i++) { echo ","; yield $i; } } function mkGenerator2(){ for($i = 10; $i <= 25; $i++) { echo ";"; yield $i; } } $generator1 = mkGenerator(); $generator2 = mkGenerator2(); $multiIterator = new \MultipleIterator(\MultipleIterator::MIT_NEED_ANY); $multiIterator->attachIterator($generator1); $multiIterator->attachIterator($generator2); foreach( $multiIterator as $data ) { echo "."; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 20
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/TjUCI
function name:  (null)
number of ops:  22
compiled vars:  !0 = $generator1, !1 = $generator2, !2 = $multiIterator, !3 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'mkgenerator'
          1        DO_FCALL                                      0  $4      
          2        ASSIGN                                                   !0, $4
   18     3        INIT_FCALL                                               'mkgenerator2'
          4        DO_FCALL                                      0  $6      
          5        ASSIGN                                                   !1, $6
   20     6        NEW                                              $8      'MultipleIterator'
          7        SEND_VAL_EX                                              0
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !2, $8
   21    10        INIT_METHOD_CALL                                         !2, 'attachIterator'
         11        SEND_VAR_EX                                              !0
         12        DO_FCALL                                      0          
   22    13        INIT_METHOD_CALL                                         !2, 'attachIterator'
         14        SEND_VAR_EX                                              !1
         15        DO_FCALL                                      0          
   24    16      > FE_RESET_R                                       $13     !2, ->20
         17    > > FE_FETCH_R                                               $13, !3, ->20
   25    18    >   ECHO                                                     '.'
   24    19      > JMP                                                      ->17
         20    >   FE_FREE                                                  $13
   26    21      > RETURN                                                   1

Function mkgenerator:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 3
Branch analysis from position: 8
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 3
Branch analysis from position: 8
Branch analysis from position: 3
filename:       /in/TjUCI
function name:  mkGenerator
number of ops:  9
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                         
    4     1        ASSIGN                                                   !0, 0
          2      > JMP                                                      ->6
    5     3    >   ECHO                                                     '%2C'
    6     4        YIELD                                                    !0
    4     5        PRE_INC                                                  !0
          6    >   IS_SMALLER_OR_EQUAL                                      !0, 10
          7      > JMPNZ                                                    ~4, ->3
    8     8    > > GENERATOR_RETURN                                         

End of function mkgenerator

Function mkgenerator2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 3
Branch analysis from position: 8
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 3
Branch analysis from position: 8
Branch analysis from position: 3
filename:       /in/TjUCI
function name:  mkGenerator2
number of ops:  9
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   GENERATOR_CREATE                                         
   11     1        ASSIGN                                                   !0, 10
          2      > JMP                                                      ->6
   12     3    >   ECHO                                                     '%3B'
   13     4        YIELD                                                    !0
   11     5        PRE_INC                                                  !0
          6    >   IS_SMALLER_OR_EQUAL                                      !0, 25
          7      > JMPNZ                                                    ~4, ->3
   15     8    > > GENERATOR_RETURN                                         

End of function mkgenerator2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.49 ms | 1403 KiB | 15 Q