3v4l.org

run code in 300+ PHP versions simultaneously
<?php function generator() { $a = 0; $b = 1; yield $b; while(true) { $c = $a+$b; $a = $b; $b = $c; yield $c; } } foreach(generator() as $value) { echo $value; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/PNFbR
function name:  (null)
number of ops:  8
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'generator'
          1        DO_FCALL                                      0  $1      
          2      > FE_RESET_R                                       $2      $1, ->6
          3    > > FE_FETCH_R                                               $2, !0, ->6
   17     4    >   ECHO                                                     !0
   16     5      > JMP                                                      ->3
          6    >   FE_FREE                                                  $2
   18     7      > RETURN                                                   1

Function generator:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 5
Branch analysis from position: 11
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 5
Branch analysis from position: 11
Branch analysis from position: 5
filename:       /in/PNFbR
function name:  generator
number of ops:  12
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   GENERATOR_CREATE                                         
    5     1        ASSIGN                                                   !0, 0
    6     2        ASSIGN                                                   !1, 1
    7     3        YIELD                                                    !1
    8     4      > JMP                                                      ->10
    9     5    >   ADD                                              ~6      !0, !1
          6        ASSIGN                                                   !2, ~6
   10     7        ASSIGN                                                   !0, !1
   11     8        ASSIGN                                                   !1, !2
   12     9        YIELD                                                    !2
    8    10    > > JMPNZ                                                    <true>, ->5
   14    11    > > GENERATOR_RETURN                                         

End of function generator

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.54 ms | 1390 KiB | 14 Q