3v4l.org

run code in 300+ PHP versions simultaneously
<?php $values = range( 0 , 10000000) ; $sum = 0 ; function generator( $range ){ foreach( $range as $value ){ yield $value ; } } $data = generator( $values ) ; $sum =0 ; foreach( $data as $el ){ $sum += $el ; } echo $sum ;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/sLN5E
function name:  (null)
number of ops:  18
compiled vars:  !0 = $values, !1 = $sum, !2 = $data, !3 = $el
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'range'
          1        SEND_VAL                                                 0
          2        SEND_VAL                                                 10000000
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !0, $4
    4     5        ASSIGN                                                   !1, 0
   13     6        INIT_FCALL                                               'generator'
          7        SEND_VAR                                                 !0
          8        DO_FCALL                                      0  $7      
          9        ASSIGN                                                   !2, $7
   14    10        ASSIGN                                                   !1, 0
   16    11      > FE_RESET_R                                       $10     !2, ->15
         12    > > FE_FETCH_R                                               $10, !3, ->15
   17    13    >   ASSIGN_OP                                     1          !1, !3
   16    14      > JMP                                                      ->12
         15    >   FE_FREE                                                  $10
   22    16        ECHO                                                     !1
         17      > RETURN                                                   1

Function generator:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 6
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 6
filename:       /in/sLN5E
function name:  generator
number of ops:  8
compiled vars:  !0 = $range, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        GENERATOR_CREATE                                         
    8     2      > FE_RESET_R                                       $2      !0, ->6
          3    > > FE_FETCH_R                                               $2, !1, ->6
    9     4    >   YIELD                                                    !1
    8     5      > JMP                                                      ->3
          6    >   FE_FREE                                                  $2
   11     7      > GENERATOR_RETURN                                         

End of function generator

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.61 ms | 1399 KiB | 16 Q