3v4l.org

run code in 300+ PHP versions simultaneously
<?php function del1() { yield 1; return 'hi'; } function del2() { yield 2; } function g_master() { $x = yield from del1(); echo "lv ", $x, "\n"; yield 3; $y = yield from del2(); echo "lv2 ", $y, "\n"; yield 4; return 5; } foreach (g_master() as $x) { echo $x, "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/Eb1PT
function name:  (null)
number of ops:  9
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_FCALL                                               'g_master'
          1        DO_FCALL                                      0  $1      
          2      > FE_RESET_R                                       $2      $1, ->7
          3    > > FE_FETCH_R                                               $2, !0, ->7
   23     4    >   ECHO                                                     !0
          5        ECHO                                                     '%0A'
   22     6      > JMP                                                      ->3
          7    >   FE_FREE                                                  $2
   24     8      > RETURN                                                   1

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

End of function del1

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

End of function del2

Function g_master:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/Eb1PT
function name:  g_master
number of ops:  19
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   GENERATOR_CREATE                                         
   13     1        INIT_FCALL                                               'del1'
          2        DO_FCALL                                      0  $2      
          3        YIELD_FROM                                       ~3      $2
          4        ASSIGN                                                   !0, ~3
   14     5        ECHO                                                     'lv+'
          6        ECHO                                                     !0
          7        ECHO                                                     '%0A'
   15     8        YIELD                                                    3
   16     9        INIT_FCALL                                               'del2'
         10        DO_FCALL                                      0  $6      
         11        YIELD_FROM                                       ~7      $6
         12        ASSIGN                                                   !1, ~7
   17    13        ECHO                                                     'lv2+'
         14        ECHO                                                     !1
         15        ECHO                                                     '%0A'
   18    16        YIELD                                                    4
   19    17      > GENERATOR_RETURN                                         
   20    18*     > GENERATOR_RETURN                                         

End of function g_master

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.44 ms | 1403 KiB | 16 Q