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; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gmpTN
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E > > 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/gmpTN
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:
154.5 ms | 1394 KiB | 13 Q