3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function generate() { try { yield 1; yield 2; } finally { echo "finally\n"; } } foreach (generate() as $i) { echo $i, "\n"; throw new Exception(); }
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
Jump found. Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
Jump found. Position 1 = -2
Branch analysis from position: 11
Jump found. Position 1 = -2
Branch analysis from position: 11
filename:       /in/QX4qP
function name:  (null)
number of ops:  13
compiled vars:  !0 = $i
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
  13     1        INIT_FCALL                                               'generate'
         2        DO_FCALL                                      0  $1      
         3      > FE_RESET_R                                       $2      $1, ->11
         4    > > FE_FETCH_R                                               $2, !0, ->11
  14     5    >   ECHO                                                     !0
         6        ECHO                                                     '%0A'
  15     7        NEW                                              $3      :-4
         8        DO_FCALL                                      0          
         9      > THROW                                         0          $3
        10*       JMP                                                      ->4
        11    >   FE_FREE                                                  $2
        12      > RETURN                                                   1

Function generate:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 4
Branch analysis from position: 4
Jump found. Position 1 = 6
Branch analysis from position: 6
Jump found. Position 1 = -2
filename:       /in/QX4qP
function name:  generate
number of ops:  7
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   6     0  E >   YIELD                                                    1
   7     1        YIELD                                                    2
         2      > FAST_CALL                                                ->4
         3*       JMP                                                      ->6
   9     4    >   ECHO                                                     'finally%0A'
         5      > FAST_RET                                                 
  11     6    > > GENERATOR_RETURN                                         

End of function generate

Generated using Vulcan Logic Dumper, using php 7.1.0