3v4l.org

run code in 300+ PHP versions simultaneously
<?php function generate($to, $form, $interval) { for ($from; $from <= $to; $from += $interval) { yield $from; } } var_dump(generate(100, 1, 1)); echo "NEXT LINE";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mpnBu
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'generate'
          2        SEND_VAL                                                 100
          3        SEND_VAL                                                 1
          4        SEND_VAL                                                 1
          5        DO_FCALL                                      0  $0      
          6        SEND_VAR                                                 $0
          7        DO_ICALL                                                 
   10     8        ECHO                                                     'NEXT+LINE'
          9      > RETURN                                                   1

Function generate:
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/mpnBu
function name:  generate
number of ops:  10
compiled vars:  !0 = $to, !1 = $form, !2 = $interval, !3 = $from
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        GENERATOR_CREATE                                         
    4     4      > JMP                                                      ->7
    5     5    >   YIELD                                                    !3
    4     6        ASSIGN_OP                                     1          !3, !2
          7    >   IS_SMALLER_OR_EQUAL                                      !3, !0
          8      > JMPNZ                                                    ~6, ->5
    7     9    > > GENERATOR_RETURN                                         

End of function generate

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.39 ms | 1398 KiB | 16 Q