3v4l.org

run code in 300+ PHP versions simultaneously
<?php function xrange($from, $till, $step) { if ($from>$till || $step<=0) { throw new InvalidArgumentException('Invalid range initializers'); } for ($i = $from; $i < $till; $i += $step) { yield $i; } } //... foreach (xrange(2, 13, 3) as $i) { echo($i.PHP_EOL); // 2,5,8,11 }
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
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/o32Mq
function name:  (null)
number of ops:  12
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'xrange'
          1        SEND_VAL                                                 2
          2        SEND_VAL                                                 13
          3        SEND_VAL                                                 3
          4        DO_FCALL                                      0  $1      
          5      > FE_RESET_R                                       $2      $1, ->10
          6    > > FE_FETCH_R                                               $2, !0, ->10
   19     7    >   CONCAT                                           ~3      !0, '%0A'
          8        ECHO                                                     ~3
   17     9      > JMP                                                      ->6
         10    >   FE_FREE                                                  $2
   20    11      > RETURN                                                   1

Function xrange:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 15
Branch analysis from position: 19
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 15
Branch analysis from position: 19
Branch analysis from position: 15
Branch analysis from position: 8
filename:       /in/o32Mq
function name:  xrange
number of ops:  20
compiled vars:  !0 = $from, !1 = $till, !2 = $step, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        GENERATOR_CREATE                                         
    4     4        IS_SMALLER                                       ~4      !1, !0
          5      > JMPNZ_EX                                         ~4      ~4, ->8
          6    >   IS_SMALLER_OR_EQUAL                              ~5      !2, 0
          7        BOOL                                             ~4      ~5
          8    > > JMPZ                                                     ~4, ->13
    6     9    >   NEW                                              $6      'InvalidArgumentException'
         10        SEND_VAL_EX                                              'Invalid+range+initializers'
         11        DO_FCALL                                      0          
         12      > THROW                                         0          $6
    9    13    >   ASSIGN                                                   !3, !0
         14      > JMP                                                      ->17
   11    15    >   YIELD                                                    !3
    9    16        ASSIGN_OP                                     1          !3, !2
         17    >   IS_SMALLER                                               !3, !1
         18      > JMPNZ                                                    ~11, ->15
   13    19    > > GENERATOR_RETURN                                         

End of function xrange

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.56 ms | 1403 KiB | 14 Q