3v4l.org

run code in 300+ PHP versions simultaneously
<?php function numbers() { $numbers = [1, 2, 3]; foreach($numbers as $number) { echo $number . PHP_EOL; yield letters(); } } function letters() { $letters = ['A', 'B', 'C']; foreach ($letters as $letter) { echo $letter . PHP_EOL; yield numbers(); } } numbers();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gsGp3
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_FCALL                                               'numbers'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Function numbers:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 10
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 10
filename:       /in/gsGp3
function name:  numbers
number of ops:  12
compiled vars:  !0 = $numbers, !1 = $number
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                         
    5     1        ASSIGN                                                   !0, <array>
    7     2      > FE_RESET_R                                       $3      !0, ->10
          3    > > FE_FETCH_R                                               $3, !1, ->10
    8     4    >   CONCAT                                           ~4      !1, '%0A'
          5        ECHO                                                     ~4
    9     6        INIT_FCALL_BY_NAME                                       'letters'
          7        DO_FCALL                                      0  $5      
          8        YIELD                                                    $5
    7     9      > JMP                                                      ->3
         10    >   FE_FREE                                                  $3
   11    11      > GENERATOR_RETURN                                         

End of function numbers

Function letters:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 10
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 10
filename:       /in/gsGp3
function name:  letters
number of ops:  12
compiled vars:  !0 = $letters, !1 = $letter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   GENERATOR_CREATE                                         
   15     1        ASSIGN                                                   !0, <array>
   17     2      > FE_RESET_R                                       $3      !0, ->10
          3    > > FE_FETCH_R                                               $3, !1, ->10
   19     4    >   CONCAT                                           ~4      !1, '%0A'
          5        ECHO                                                     ~4
   20     6        INIT_FCALL                                               'numbers'
          7        DO_FCALL                                      0  $5      
          8        YIELD                                                    $5
   17     9      > JMP                                                      ->3
         10    >   FE_FREE                                                  $3
   22    11      > GENERATOR_RETURN                                         

End of function letters

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.69 ms | 1398 KiB | 15 Q