3v4l.org

run code in 300+ PHP versions simultaneously
<?php function simpleGenerator(){ yield "first"; yield "second"; yield "third"; for ($i = 0; $i < 3; $i++) yield i; } $g = "simpleGenerator"; print $g(); print $g(); print $g(); print $g(); print $g(); print $g(); print $g();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rqHLl
function name:  (null)
number of ops:  23
compiled vars:  !0 = $g
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, 'simpleGenerator'
   10     1        INIT_DYNAMIC_CALL                                        !0
          2        DO_FCALL                                      0  $2      
          3        ECHO                                                     $2
   11     4        INIT_DYNAMIC_CALL                                        !0
          5        DO_FCALL                                      0  $3      
          6        ECHO                                                     $3
   12     7        INIT_DYNAMIC_CALL                                        !0
          8        DO_FCALL                                      0  $4      
          9        ECHO                                                     $4
   13    10        INIT_DYNAMIC_CALL                                        !0
         11        DO_FCALL                                      0  $5      
         12        ECHO                                                     $5
   14    13        INIT_DYNAMIC_CALL                                        !0
         14        DO_FCALL                                      0  $6      
         15        ECHO                                                     $6
   15    16        INIT_DYNAMIC_CALL                                        !0
         17        DO_FCALL                                      0  $7      
         18        ECHO                                                     $7
   16    19        INIT_DYNAMIC_CALL                                        !0
         20        DO_FCALL                                      0  $8      
         21        ECHO                                                     $8
         22      > RETURN                                                   1

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

End of function simplegenerator

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.44 ms | 1395 KiB | 13 Q