3v4l.org

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

Function gen:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/7RXKL
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        YIELD                                                    1
    6     2        YIELD                                                    3
    7     3      > GENERATOR_RETURN                                         

End of function gen

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.38 ms | 943 KiB | 15 Q