3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = function() { try { yield 1; } finally { throw new Exception(); } }; $b = function() { yield 1; }; echo "starting "; try { foreach ($a() as $x) { foreach ($b() as $y) { return true; } } } catch (Exception $e) { echo "caught exception.\n"; } echo "exit.\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 19
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 19
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 17
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 17
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 17
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
Found catch point at position: 21
Branch analysis from position: 21
2 jumps found. (Code = 107) Position 1 = 22, Position 2 = -2
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qPrD1
function name:  (null)
number of ops:  25
compiled vars:  !0 = $a, !1 = $b, !2 = $x, !3 = $y, !4 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FqPrD1%3A4%240'
          1        ASSIGN                                                   !0, ~5
   12     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FqPrD1%3A12%241'
          3        ASSIGN                                                   !1, ~7
   16     4        ECHO                                                     'starting+'
   18     5        INIT_DYNAMIC_CALL                                        !0
          6        DO_FCALL                                      0  $9      
          7      > FE_RESET_R                                       $10     $9, ->19
          8    > > FE_FETCH_R                                               $10, !2, ->19
   19     9    >   INIT_DYNAMIC_CALL                                        !1
         10        DO_FCALL                                      0  $11     
         11      > FE_RESET_R                                       $12     $11, ->17
         12    > > FE_FETCH_R                                               $12, !3, ->17
   20    13    >   FE_FREE                                                  $12
         14        FE_FREE                                                  $10
         15      > RETURN                                                   <true>
   19    16*       JMP                                                      ->12
         17    >   FE_FREE                                                  $12
   18    18      > JMP                                                      ->8
         19    >   FE_FREE                                                  $10
         20      > JMP                                                      ->23
   23    21  E > > CATCH                                       last         'Exception'
   24    22    >   ECHO                                                     'caught+exception.%0A'
   26    23    >   ECHO                                                     'exit.%0A'
         24      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FqPrD1%3A4%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 162) Position 1 = 4, Position 2 = 3
Branch analysis from position: 4
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/qPrD1
function name:  {closure}
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   GENERATOR_CREATE                                         
    6     1        YIELD                                                    1
    7     2      > FAST_CALL                                                ->4
          3    > > JMP                                                      ->8
    8     4    >   NEW                                              $2      'Exception'
          5        DO_FCALL                                      0          
          6      > THROW                                         0          $2
          7*       FAST_RET                                                 
   10     8    > > GENERATOR_RETURN                                         

End of function %00%7Bclosure%7D%2Fin%2FqPrD1%3A4%240

Function %00%7Bclosure%7D%2Fin%2FqPrD1%3A12%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/qPrD1
function name:  {closure}
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   GENERATOR_CREATE                                         
   13     1        YIELD                                                    1
   14     2      > GENERATOR_RETURN                                         

End of function %00%7Bclosure%7D%2Fin%2FqPrD1%3A12%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.12 ms | 1399 KiB | 13 Q