3v4l.org

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

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/mlt4G
function name:  f
number of ops:  9
compiled vars:  !0 = $gen
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        GENERATOR_CREATE                                         
    4     2        YIELD                                                    'foo'
    5     3        INIT_METHOD_CALL                                         !0, 'throw'
          4        NEW                                              $2      'Exception'
          5        DO_FCALL                                      0          
          6        SEND_VAR_NO_REF_EX                                       $2
          7        DO_FCALL                                      0          
    6     8      > GENERATOR_RETURN                                         

End of function f

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.21 ms | 1010 KiB | 14 Q