3v4l.org

run code in 300+ PHP versions simultaneously
<?php function doStuff() { $last = 0; $current = 1; echo "l, c: $last, $current\n"; yield 1; while ($current < 10000) { echo "l, c: $last, $current\n"; $current = $last + $current; $last = $current - $last; yield $current; echo "l, c: $last, $current\n"; } } foreach(doStuff() as $num) $num; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/j5AAZ
function name:  (null)
number of ops:  7
compiled vars:  !0 = $num
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'dostuff'
          1        DO_FCALL                                      0  $1      
          2      > FE_RESET_R                                       $2      $1, ->5
          3    > > FE_FETCH_R                                               $2, !0, ->5
          4    > > JMP                                                      ->3
          5    >   FE_FREE                                                  $2
   19     6      > RETURN                                                   1

Function dostuff:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 11
Branch analysis from position: 30
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 11
Branch analysis from position: 30
Branch analysis from position: 11
filename:       /in/j5AAZ
function name:  doStuff
number of ops:  31
compiled vars:  !0 = $last, !1 = $current
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                         
    4     1        ASSIGN                                                   !0, 0
    5     2        ASSIGN                                                   !1, 1
    6     3        ROPE_INIT                                     5  ~5      'l%2C+c%3A+'
          4        ROPE_ADD                                      1  ~5      ~5, !0
          5        ROPE_ADD                                      2  ~5      ~5, '%2C+'
          6        ROPE_ADD                                      3  ~5      ~5, !1
          7        ROPE_END                                      4  ~4      ~5, '%0A'
          8        ECHO                                                     ~4
    7     9        YIELD                                                    1
    8    10      > JMP                                                      ->28
    9    11    >   ROPE_INIT                                     5  ~10     'l%2C+c%3A+'
         12        ROPE_ADD                                      1  ~10     ~10, !0
         13        ROPE_ADD                                      2  ~10     ~10, '%2C+'
         14        ROPE_ADD                                      3  ~10     ~10, !1
         15        ROPE_END                                      4  ~9      ~10, '%0A'
         16        ECHO                                                     ~9
   10    17        ADD                                              ~13     !0, !1
         18        ASSIGN                                                   !1, ~13
   11    19        SUB                                              ~15     !1, !0
         20        ASSIGN                                                   !0, ~15
   12    21        YIELD                                                    !1
   13    22        ROPE_INIT                                     5  ~19     'l%2C+c%3A+'
         23        ROPE_ADD                                      1  ~19     ~19, !0
         24        ROPE_ADD                                      2  ~19     ~19, '%2C+'
         25        ROPE_ADD                                      3  ~19     ~19, !1
         26        ROPE_END                                      4  ~18     ~19, '%0A'
         27        ECHO                                                     ~18
    8    28    >   IS_SMALLER                                               !1, 10000
         29      > JMPNZ                                                    ~22, ->11
   15    30    > > GENERATOR_RETURN                                         

End of function dostuff

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.96 ms | 1402 KiB | 14 Q