3v4l.org

run code in 500+ PHP versions simultaneously
<?php $g = function (): Generator { yield from [1,2,3,4]; }; foreach($g() as $h) { print "h:$h - "; foreach($g() as $i) { echo "i:$i + "; break 1; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 22
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 22
Branch analysis from position: 6
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 20
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 20
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 20
Branch analysis from position: 20
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/cF28h
function name:  (null)
number of ops:  24
compiled vars:  !0 = $g, !1 = $h, !2 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                              ~3      [0]
          1        ASSIGN                                                       !0, ~3
    7     2        INIT_DYNAMIC_CALL                                            !0
          3        DO_FCALL                                          0  $5      
          4      > FE_RESET_R                                           $6      $5, ->22
          5    > > FE_FETCH_R                                                   $6, !1, ->22
    8     6    >   ROPE_INIT                                         3  ~8      'h%3A'
          7        ROPE_ADD                                          1  ~8      ~8, !1
          8        ROPE_END                                          2  ~7      ~8, '+-+'
          9        ECHO                                                         ~7
    9    10        INIT_DYNAMIC_CALL                                            !0
         11        DO_FCALL                                          0  $10     
         12      > FE_RESET_R                                           $11     $10, ->20
         13    > > FE_FETCH_R                                                   $11, !2, ->20
   10    14    >   ROPE_INIT                                         3  ~13     'i%3A'
         15        ROPE_ADD                                          1  ~13     ~13, !2
         16        ROPE_END                                          2  ~12     ~13, '+%2B+'
         17        ECHO                                                         ~12
   12    18      > JMP                                                          ->20
    9    19*       JMP                                                          ->13
         20    >   FE_FREE                                                      $11
    7    21      > JMP                                                          ->5
         22    >   FE_FREE                                                      $6
   14    23      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/cF28h
function name:  {closure:/in/cF28h:3}
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                             
    4     1        YIELD_FROM                                           ~0      <array>
          2        FREE                                                         ~0
    5     3      > GENERATOR_RETURN                                             

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
131.66 ms | 1353 KiB | 13 Q