3v4l.org

run code in 300+ PHP versions simultaneously
<?php function generator() { yield 'First value'; for ($i = 1; $i <= 3; $i++) { yield $i; } } $gen = generator(); $first = $gen->current(); foreach ($gen as $value) { echo $value . '<br/>'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/E2Iio
function name:  (null)
number of ops:  13
compiled vars:  !0 = $gen, !1 = $first, !2 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'generator'
          1        DO_FCALL                                      0  $3      
          2        ASSIGN                                                   !0, $3
   12     3        INIT_METHOD_CALL                                         !0, 'current'
          4        DO_FCALL                                      0  $5      
          5        ASSIGN                                                   !1, $5
   14     6      > FE_RESET_R                                       $7      !0, ->11
          7    > > FE_FETCH_R                                               $7, !2, ->11
   15     8    >   CONCAT                                           ~8      !2, '%3Cbr%2F%3E'
          9        ECHO                                                     ~8
   14    10      > JMP                                                      ->7
         11    >   FE_FREE                                                  $7
   16    12      > RETURN                                                   1

Function generator:
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 = 4
Branch analysis from position: 8
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 4
Branch analysis from position: 8
Branch analysis from position: 4
filename:       /in/E2Iio
function name:  generator
number of ops:  9
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                         
    4     1        YIELD                                                    'First+value'
    5     2        ASSIGN                                                   !0, 1
          3      > JMP                                                      ->6
    6     4    >   YIELD                                                    !0
    5     5        PRE_INC                                                  !0
          6    >   IS_SMALLER_OR_EQUAL                                      !0, 3
          7      > JMPNZ                                                    ~5, ->4
    8     8    > > GENERATOR_RETURN                                         

End of function generator

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.53 ms | 1399 KiB | 14 Q