3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Simple implementation of range() as a generator * @param int $start * @param int $end * @return void */ function range_yield($start, $end) { for ($index = $start; $index <= $end; $index++) { yield $index => $index; } } var_export(range_yield(0, 1000000));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZVHMP
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'var_export'
          1        INIT_FCALL                                               'range_yield'
          2        SEND_VAL                                                 0
          3        SEND_VAL                                                 1000000
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function range_yield:
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 = 9, Position 2 = 5
Branch analysis from position: 9
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 5
Branch analysis from position: 9
Branch analysis from position: 5
filename:       /in/ZVHMP
function name:  range_yield
number of ops:  10
compiled vars:  !0 = $start, !1 = $end, !2 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        GENERATOR_CREATE                                         
   10     3        ASSIGN                                                   !2, !0
          4      > JMP                                                      ->7
   11     5    >   YIELD                                                    !2, !2
   10     6        PRE_INC                                                  !2
          7    >   IS_SMALLER_OR_EQUAL                                      !2, !1
          8      > JMPNZ                                                    ~6, ->5
   13     9    > > GENERATOR_RETURN                                         

End of function range_yield

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.14 ms | 1389 KiB | 16 Q