3v4l.org

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

End of function generate

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.26 ms | 1398 KiB | 16 Q