3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gen() { yield 1; yield 2; yield 3; } $times = 1; foreach(gen() as $g) { echo $times++; var_dump($g->getIterator()); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 13
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/vbWn8
function name:  (null)
number of ops:  15
compiled vars:  !0 = $times, !1 = $g
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, 1
    8     1        INIT_FCALL                                               'gen'
          2        DO_FCALL                                      0  $3      
          3      > FE_RESET_R                                       $4      $3, ->13
          4    > > FE_FETCH_R                                               $4, !1, ->13
    9     5    >   POST_INC                                         ~5      !0
          6        ECHO                                                     ~5
   10     7        INIT_FCALL                                               'var_dump'
          8        INIT_METHOD_CALL                                         !1, 'getIterator'
          9        DO_FCALL                                      0  $6      
         10        SEND_VAR                                                 $6
         11        DO_ICALL                                                 
    8    12      > JMP                                                      ->4
         13    >   FE_FREE                                                  $4
   11    14      > RETURN                                                   1

Function gen:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/vbWn8
function name:  gen
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   GENERATOR_CREATE                                         
    3     1        YIELD                                                    1
    4     2        YIELD                                                    2
    5     3        YIELD                                                    3
    6     4      > GENERATOR_RETURN                                         

End of function gen

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.24 ms | 1398 KiB | 16 Q