3v4l.org

run code in 500+ PHP versions simultaneously
<?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
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/QX4qP
function name:  (null)
number of ops:  12
compiled vars:  !0 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                                   'generate'
          1        DO_FCALL                                          0  $1      
          2      > FE_RESET_R                                           $2      $1, ->10
          3    > > FE_FETCH_R                                                   $2, !0, ->10
   14     4    >   ECHO                                                         !0
          5        ECHO                                                         '%0A'
   15     6        NEW                                                  $3      'Exception'
          7        DO_FCALL                                          0          
          8      > THROW                                             0          $3
   13     9*       JMP                                                          ->3
         10    >   FE_FREE                                                      $2
   16    11      > RETURN                                                       1

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

End of function generate

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.81 ms | 3321 KiB | 14 Q