3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fooGenerator() { $range = range(0, 1000); try { foreach ($range as $key) { yield $key; } } finally { var_dump($this, 'Closed!'); } } $iterator = fooGenerator(); foreach ($iterator as $key) { break; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
Branch analysis from position: 7
filename:       /in/ot7F5
function name:  (null)
number of ops:  9
compiled vars:  !0 = $iterator, !1 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'foogenerator'
          1        DO_FCALL                                      0  $2      
          2        ASSIGN                                                   !0, $2
   18     3      > FE_RESET_R                                       $4      !0, ->7
          4    > > FE_FETCH_R                                               $4, !1, ->7
   19     5    > > JMP                                                      ->7
   18     6*       JMP                                                      ->4
          7    >   FE_FREE                                                  $4
   20     8      > RETURN                                                   1

Function foogenerator:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 10
2 jumps found. (Code = 162) Position 1 = 13, Position 2 = 12
Branch analysis from position: 13
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 10
filename:       /in/ot7F5
function name:  fooGenerator
number of ops:  20
compiled vars:  !0 = $range, !1 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                         
    4     1        INIT_FCALL                                               'range'
          2        SEND_VAL                                                 0
          3        SEND_VAL                                                 1000
          4        DO_ICALL                                         $2      
          5        ASSIGN                                                   !0, $2
    6     6      > FE_RESET_R                                       $5      !0, ->10
          7    > > FE_FETCH_R                                               $5, !1, ->10
    7     8    >   YIELD                                                    !1
    6     9      > JMP                                                      ->7
         10    >   FE_FREE                                                  $5
    9    11      > FAST_CALL                                                ->13
         12    > > JMP                                                      ->19
   10    13    >   INIT_FCALL                                               'var_dump'
         14        FETCH_THIS                                       ~7      
         15        SEND_VAL                                                 ~7
         16        SEND_VAL                                                 'Closed%21'
         17        DO_ICALL                                                 
         18      > FAST_RET                                                 
   13    19    > > GENERATOR_RETURN                                         

End of function foogenerator

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.23 ms | 1399 KiB | 18 Q