3v4l.org

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

Function gen:
Finding entry points
Branch analysis from position: 0
Jump 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 7.1.0