3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gen() { print yield; throw \Exception; } $gen = gen(); try { $gen->send(5); } catch (\Exception $e) { print "Exception"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 7
Branch analysis from position: 7
2 jumps found. (Code = 107) Position 1 = 8, Position 2 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dXjFL
function name:  (null)
number of ops:  10
compiled vars:  !0 = $gen, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'gen'
          1        DO_FCALL                                      0  $2      
          2        ASSIGN                                                   !0, $2
   11     3        INIT_METHOD_CALL                                         !0, 'send'
          4        SEND_VAL_EX                                              5
          5        DO_FCALL                                      0          
          6      > JMP                                                      ->9
   13     7  E > > CATCH                                       last         'Exception'
   14     8    >   ECHO                                                     'Exception'
   15     9    > > RETURN                                                   1

Function gen:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/dXjFL
function name:  gen
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                         
    4     1        YIELD                                            $0      
          2        ECHO                                                     $0
    5     3        FETCH_CONSTANT                                   ~1      'Exception'
          4      > THROW                                         0          ~1
    6     5*     > GENERATOR_RETURN                                         

End of function gen

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.36 ms | 1397 KiB | 14 Q