3v4l.org

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

Function %00%7Bclosure%7D%2Fin%2Fmc3gj%3A3%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/mc3gj
function name:  {closure}
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                         
    5     1        YIELD                                                    1
    6     2      > FAST_CALL                                                ->4
          3    > > JMP                                                      ->8
    7     4    >   NEW                                              $2      'Exception'
          5        DO_FCALL                                      0          
          6      > THROW                                         0          $2
          7*       FAST_RET                                                 
    9     8    > > GENERATOR_RETURN                                         

End of function %00%7Bclosure%7D%2Fin%2Fmc3gj%3A3%240

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

End of function %00%7Bclosure%7D%2Fin%2Fmc3gj%3A11%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.62 ms | 1399 KiB | 13 Q