3v4l.org

run code in 300+ PHP versions simultaneously
<?php function grange($from, $to) { for ($i = $from; is_infinite($to) ?: $i <= $to; $i++) { yield $i; } } foreach (grange(1, INF) as $element) { if ($element > 20) { break; } echo $element."\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 12
Branch analysis from position: 12
filename:       /in/3ZXDG
function name:  (null)
number of ops:  14
compiled vars:  !0 = $element
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'grange'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 INF
          3        DO_FCALL                                      0  $1      
          4      > FE_RESET_R                                       $2      $1, ->12
          5    > > FE_FETCH_R                                               $2, !0, ->12
   10     6    >   IS_SMALLER                                               20, !0
          7      > JMPZ                                                     ~3, ->9
   11     8    > > JMP                                                      ->12
   14     9    >   CONCAT                                           ~4      !0, '%0A'
         10        ECHO                                                     ~4
    9    11      > JMP                                                      ->5
         12    >   FE_FREE                                                  $2
   15    13      > RETURN                                                   1

Function grange:
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 = 14, Position 2 = 5
Branch analysis from position: 14
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 5
Branch analysis from position: 14
Branch analysis from position: 5
filename:       /in/3ZXDG
function name:  grange
number of ops:  15
compiled vars:  !0 = $from, !1 = $to, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     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    >   INIT_FCALL                                               'is_infinite'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $6      
         10        JMP_SET                                          ~7      $6, ->13
         11        IS_SMALLER_OR_EQUAL                              ~8      !2, !1
         12        QM_ASSIGN                                        ~7      ~8
         13      > JMPNZ                                                    ~7, ->5
    7    14    > > GENERATOR_RETURN                                         

End of function grange

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154 ms | 1399 KiB | 16 Q