3v4l.org

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

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

End of function gen

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.55 ms | 1402 KiB | 15 Q