3v4l.org

run code in 300+ PHP versions simultaneously
<?php function xrange($start, $end, $step = 1) { for ($i = $start; $i <= $end; $i += $step) { yield $i; } } foreach (xrange(1, 5) as $i) { echo "$i\n"; } // Po dobu 0.1 sekundy vypisuje čísla. $start = microtime(true); foreach (xrange(1, INF) as $i) { if (microtime(true) - $start > .1) { break; } echo "$i\n"; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 10
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 32
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 32
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 28
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 32
Branch analysis from position: 32
Branch analysis from position: 10
filename:       /in/C4rNJ
function name:  (null)
number of ops:  34
compiled vars:  !0 = $i, !1 = $start
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'xrange'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 5
          3        DO_FCALL                                      0  $2      
          4      > FE_RESET_R                                       $3      $2, ->10
          5    > > FE_FETCH_R                                               $3, !0, ->10
    8     6    >   NOP                                                      
          7        FAST_CONCAT                                      ~4      !0, '%0A'
          8        ECHO                                                     ~4
    7     9      > JMP                                                      ->5
         10    >   FE_FREE                                                  $3
   11    11        INIT_FCALL                                               'microtime'
         12        SEND_VAL                                                 <true>
         13        DO_ICALL                                         $5      
         14        ASSIGN                                                   !1, $5
   12    15        INIT_FCALL                                               'xrange'
         16        SEND_VAL                                                 1
         17        SEND_VAL                                                 INF
         18        DO_FCALL                                      0  $7      
         19      > FE_RESET_R                                       $8      $7, ->32
         20    > > FE_FETCH_R                                               $8, !0, ->32
   13    21    >   INIT_FCALL                                               'microtime'
         22        SEND_VAL                                                 <true>
         23        DO_ICALL                                         $9      
         24        SUB                                              ~10     $9, !1
         25        IS_SMALLER                                               0.1, ~10
         26      > JMPZ                                                     ~11, ->28
   14    27    > > JMP                                                      ->32
   16    28    >   NOP                                                      
         29        FAST_CONCAT                                      ~12     !0, '%0A'
         30        ECHO                                                     ~12
   12    31      > JMP                                                      ->20
         32    >   FE_FREE                                                  $8
   18    33      > RETURN                                                   1

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

End of function xrange

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.68 ms | 1402 KiB | 17 Q