3v4l.org

run code in 300+ PHP versions simultaneously
<?php function generate() { try { yield 1; yield 2; } catch(\Exception $e) { echo 'catch'; } finally { echo "finally\n"; } } try { foreach (generate() as $i) { echo $i, "\n"; exit(0); } } catch(Exception $e) { echo 'outer catch'; } finally { echo "outer finally\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 162) Position 1 = 14, Position 2 = 13
Branch analysis from position: 14
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
Found catch point at position: 10
Branch analysis from position: 10
2 jumps found. (Code = 107) Position 1 = 11, Position 2 = -2
Branch analysis from position: 11
2 jumps found. (Code = 162) Position 1 = 14, Position 2 = 13
Branch analysis from position: 14
Branch analysis from position: 13
filename:       /in/HGKHS
function name:  (null)
number of ops:  17
compiled vars:  !0 = $i, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'generate'
          1        DO_FCALL                                      0  $3      
          2      > FE_RESET_R                                       $4      $3, ->8
          3    > > FE_FETCH_R                                               $4, !0, ->8
   17     4    >   ECHO                                                     !0
          5        ECHO                                                     '%0A'
   18     6      > EXIT                                                     0
   16     7*       JMP                                                      ->3
          8    >   FE_FREE                                                  $4
          9      > JMP                                                      ->12
   20    10  E > > CATCH                                       last         'Exception'
   21    11    >   ECHO                                                     'outer+catch'
   22    12    > > FAST_CALL                                                ->14
         13    > > JMP                                                      ->16
   23    14    >   ECHO                                                     'outer+finally%0A'
         15      > FAST_RET                                                 
   24    16    > > RETURN                                                   1

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

End of function generate

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.08 ms | 1407 KiB | 14 Q