3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gen() { for ($i = 0; $i < 10; $i++) { try { yield $i; } catch(Exception $e) { var_dump($e); } } } foreach (gen() as $i) { var_dump($i); throw new Exception($i); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/Q6Hp7
function name:  (null)
number of ops:  14
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'gen'
          1        DO_FCALL                                      0  $1      
          2      > FE_RESET_R                                       $2      $1, ->12
          3    > > FE_FETCH_R                                               $2, !0, ->12
   14     4    >   INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
   15     7        NEW                                              $4      'Exception'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
         10      > THROW                                         0          $4
   13    11*       JMP                                                      ->3
         12    >   FE_FREE                                                  $2
   16    13      > RETURN                                                   1

Function gen:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 3
Branch analysis from position: 12
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 3
Branch analysis from position: 12
Branch analysis from position: 3
Found catch point at position: 5
Branch analysis from position: 5
2 jumps found. (Code = 107) Position 1 = 6, Position 2 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 3
Branch analysis from position: 12
Branch analysis from position: 3
filename:       /in/Q6Hp7
function name:  gen
number of ops:  13
compiled vars:  !0 = $i, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                         
    4     1        ASSIGN                                                   !0, 0
          2      > JMP                                                      ->10
    6     3    >   YIELD                                                    !0
          4      > JMP                                                      ->9
    7     5  E > > CATCH                                       last         'Exception'
    8     6    >   INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
    4     9    >   PRE_INC                                                  !0
         10    >   IS_SMALLER                                               !0, 10
         11      > JMPNZ                                                    ~6, ->3
   11    12    > > GENERATOR_RETURN                                         

End of function gen

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.08 ms | 1399 KiB | 16 Q