3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { yield 'a'; yield 'b'; yield 'c'; yield 'd'; yield 'e'; } $items = foo(); foreach ( $items as $outer ) { echo "Outer element: $outer\n"; if ( $outer == 'c' ) { foreach ( $items as $inner ) { echo "Inner element: $inner\n"; } } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 20
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 20
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 19
Branch analysis from position: 11
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 18
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 18
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 18
Branch analysis from position: 19
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/BYOmQ
function name:  (null)
number of ops:  22
compiled vars:  !0 = $items, !1 = $outer, !2 = $inner
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'foo'
          1        DO_FCALL                                      0  $3      
          2        ASSIGN                                                   !0, $3
    5     3      > FE_RESET_R                                       $5      !0, ->20
          4    > > FE_FETCH_R                                               $5, !1, ->20
    6     5    >   ROPE_INIT                                     3  ~7      'Outer+element%3A+'
          6        ROPE_ADD                                      1  ~7      ~7, !1
          7        ROPE_END                                      2  ~6      ~7, '%0A'
          8        ECHO                                                     ~6
    7     9        IS_EQUAL                                                 !1, 'c'
         10      > JMPZ                                                     ~9, ->19
    8    11    > > FE_RESET_R                                       $10     !0, ->18
         12    > > FE_FETCH_R                                               $10, !2, ->18
    9    13    >   ROPE_INIT                                     3  ~12     'Inner+element%3A+'
         14        ROPE_ADD                                      1  ~12     ~12, !2
         15        ROPE_END                                      2  ~11     ~12, '%0A'
         16        ECHO                                                     ~11
    8    17      > JMP                                                      ->12
         18    >   FE_FREE                                                  $10
    5    19    > > JMP                                                      ->4
         20    >   FE_FREE                                                  $5
   12    21      > RETURN                                                   1

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

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.08 ms | 999 KiB | 14 Q