3v4l.org

run code in 500+ PHP versions simultaneously
<?php function foo() { try { foreach(range(1, 4) as $number) yield $number; } finally { echo 'Running finally block', PHP_EOL; } } foreach(foo() as $number) { echo $number, PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/BTGnQ
function name:  (null)
number of ops:  9
compiled vars:  !0 = $number
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                                   'foo'
          1        DO_FCALL                                          0  $1      
          2      > FE_RESET_R                                           $2      $1, ->7
          3    > > FE_FETCH_R                                                   $2, !0, ->7
   12     4    >   ECHO                                                         !0
          5        ECHO                                                         '%0A'
   11     6      > JMP                                                          ->3
          7    >   FE_FREE                                                      $2
   13     8      > RETURN                                                       1

Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 9
2 jumps found. (Code = 162) Position 1 = 12, Position 2 = 11
Branch analysis from position: 12
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 9
filename:       /in/BTGnQ
function name:  foo
number of ops:  16
compiled vars:  !0 = $number
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                             
    5     1        INIT_FCALL                                                   'range'
          2        SEND_VAL                                                     1
          3        SEND_VAL                                                     4
          4        DO_ICALL                                             $2      
          5      > FE_RESET_R                                           $3      $2, ->9
          6    > > FE_FETCH_R                                                   $3, !0, ->9
          7    >   YIELD                                                        !0
          8      > JMP                                                          ->6
          9    >   FE_FREE                                                      $3
    6    10      > FAST_CALL                                                    ->12
         11    > > JMP                                                          ->15
    7    12    >   ECHO                                                         'Running+finally+block'
         13        ECHO                                                         '%0A'
         14      > FAST_RET                                                     
    9    15    > > GENERATOR_RETURN                                             

End of function foo

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
178.59 ms | 3281 KiB | 15 Q