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(100, 1, 1); foreach ($values as $value) { var_dump($value); } echo "NEXT LINE";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/UDKbo
function name:  (null)
number of ops:  15
compiled vars:  !0 = $values, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'generate'
          1        SEND_VAL                                                 100
          2        SEND_VAL                                                 1
          3        SEND_VAL                                                 1
          4        DO_FCALL                                      0  $2      
          5        ASSIGN                                                   !0, $2
   10     6      > FE_RESET_R                                       $4      !0, ->12
          7    > > FE_FETCH_R                                               $4, !1, ->12
   11     8    >   INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
   10    11      > JMP                                                      ->7
         12    >   FE_FREE                                                  $4
   13    13        ECHO                                                     'NEXT+LINE'
         14      > 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/UDKbo
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:
155.63 ms | 1399 KiB | 16 Q