3v4l.org

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

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/cCe3I
function name:  foo
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   GENERATOR_CREATE                                         
    4     1        YIELD                                                    1
    5     2        YIELD                                                    2
    6     3      > GENERATOR_RETURN                                         
    7     4*     > GENERATOR_RETURN                                         

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.55 ms | 1397 KiB | 14 Q