3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fib($n) { $cur = 2; $prev = 1; for ($i = 0; $i < $n; $i++) { yield $cur; $temp = $cur; $cur = $prev + $cur; $prev = $temp; } } $fibs = fib(3); foreach ($fibs as $fib) { echo " " . $fib; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/4mthf
function name:  (null)
number of ops:  11
compiled vars:  !0 = $fibs, !1 = $fib
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'fib'
          1        SEND_VAL                                                 3
          2        DO_FCALL                                      0  $2      
          3        ASSIGN                                                   !0, $2
   16     4      > FE_RESET_R                                       $4      !0, ->9
          5    > > FE_FETCH_R                                               $4, !1, ->9
   17     6    >   CONCAT                                           ~5      '+', !1
          7        ECHO                                                     ~5
   16     8      > JMP                                                      ->5
          9    >   FE_FREE                                                  $4
   18    10      > RETURN                                                   1

Function fib:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 6
Branch analysis from position: 14
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 6
Branch analysis from position: 14
Branch analysis from position: 6
filename:       /in/4mthf
function name:  fib
number of ops:  15
compiled vars:  !0 = $n, !1 = $cur, !2 = $prev, !3 = $i, !4 = $temp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        GENERATOR_CREATE                                         
    4     2        ASSIGN                                                   !1, 2
    5     3        ASSIGN                                                   !2, 1
    6     4        ASSIGN                                                   !3, 0
          5      > JMP                                                      ->12
    7     6    >   YIELD                                                    !1
    9     7        ASSIGN                                                   !4, !1
   10     8        ADD                                              ~10     !2, !1
          9        ASSIGN                                                   !1, ~10
   11    10        ASSIGN                                                   !2, !4
    6    11        PRE_INC                                                  !3
         12    >   IS_SMALLER                                               !3, !0
         13      > JMPNZ                                                    ~14, ->6
   13    14    > > GENERATOR_RETURN                                         

End of function fib

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.7 ms | 1399 KiB | 14 Q