3v4l.org

run code in 500+ PHP versions simultaneously
<?php function gen() { return; yield 1; } $append = new \AppendIterator; $append->append(gen()); foreach ($append as $foo) {}
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 11
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/YC68k
function name:  (null)
number of ops:  13
compiled vars:  !0 = $append, !1 = $foo
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   NEW                                                  $2      'AppendIterator'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $2
    8     3        INIT_METHOD_CALL                                             !0, 'append'
          4        INIT_FCALL                                                   'gen'
          5        DO_FCALL                                          0  $5      
          6        SEND_VAR_NO_REF_EX                                           $5
          7        DO_FCALL                                          0          
    9     8      > FE_RESET_R                                           $7      !0, ->11
          9    > > FE_FETCH_R                                                   $7, !1, ->11
         10    > > JMP                                                          ->9
         11    >   FE_FREE                                                      $7
         12      > RETURN                                                       1

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

End of function gen

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.23 ms | 2801 KiB | 14 Q