3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function foo() { for ($i = 0; $i < 10 ; $i++) { yield $i; } } echo (foo()); echo (foo()); echo (foo()); echo (foo()); echo (foo());
based on Mr2VC
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mnt0r
function name:  (null)
number of ops:  17
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   NOP                                                      
   8     1        INIT_FCALL                                               'foo'
         2        DO_FCALL                                      0  $0      
         3        ECHO                                                     $0
   9     4        INIT_FCALL                                               'foo'
         5        DO_FCALL                                      0  $1      
         6        ECHO                                                     $1
  10     7        INIT_FCALL                                               'foo'
         8        DO_FCALL                                      0  $2      
         9        ECHO                                                     $2
  11    10        INIT_FCALL                                               'foo'
        11        DO_FCALL                                      0  $3      
        12        ECHO                                                     $3
  12    13        INIT_FCALL                                               'foo'
        14        DO_FCALL                                      0  $4      
        15        ECHO                                                     $4
        16      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 3
Branch analysis from position: 8
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 3
Branch analysis from position: 8
Branch analysis from position: 3
filename:       /in/mnt0r
function name:  foo
number of ops:  9
compiled vars:  !0 = $i
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   GENERATOR_CREATE                                         
   3     1        ASSIGN                                                   !0, 0
         2      > JMP                                                      ->6
   4     3    >   YIELD                                                    !0
   3     4        POST_INC                                         ~3      !0
         5        FREE                                                     ~3
         6    >   IS_SMALLER                                       ~4      !0, 10
         7      > JMPNZ                                                    ~4, ->3
   6     8    > > GENERATOR_RETURN                                         

End of function foo

Generated using Vulcan Logic Dumper, using php 7.3.0