3v4l.org

run code in 300+ PHP versions simultaneously
<?php $max = 100000; function xrange($len) { $i = 0; while ($i < $len) { yield $i; $i++; } return; } $a = $b = $c = 0; foreach (xrange($max) as $i) { $a = $a + $b + $i; $b = $a * 5678 * $i; $c = $i * $i; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 18
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 18
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/9u6Oa
function name:  (null)
number of ops:  20
compiled vars:  !0 = $max, !1 = $a, !2 = $b, !3 = $c, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 100000
   11     1        ASSIGN                                           ~6      !3, 0
          2        ASSIGN                                           ~7      !2, ~6
          3        ASSIGN                                                   !1, ~7
   12     4        INIT_FCALL                                               'xrange'
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0  $9      
          7      > FE_RESET_R                                       $10     $9, ->18
          8    > > FE_FETCH_R                                               $10, !4, ->18
   13     9    >   ADD                                              ~11     !1, !2
         10        ADD                                              ~12     ~11, !4
         11        ASSIGN                                                   !1, ~12
   14    12        MUL                                              ~14     !1, 5678
         13        MUL                                              ~15     !4, ~14
         14        ASSIGN                                                   !2, ~15
   15    15        MUL                                              ~17     !4, !4
         16        ASSIGN                                                   !3, ~17
   12    17      > JMP                                                      ->8
         18    >   FE_FREE                                                  $10
   16    19      > RETURN                                                   1

Function xrange:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 4
Branch analysis from position: 8
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 4
Branch analysis from position: 8
Branch analysis from position: 4
filename:       /in/9u6Oa
function name:  xrange
number of ops:  10
compiled vars:  !0 = $len, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        GENERATOR_CREATE                                         
    4     2        ASSIGN                                                   !1, 0
    5     3      > JMP                                                      ->6
    6     4    >   YIELD                                                    !1
    7     5        PRE_INC                                                  !1
    5     6    >   IS_SMALLER                                               !1, !0
          7      > JMPNZ                                                    ~5, ->4
    9     8    > > GENERATOR_RETURN                                         
   10     9*     > GENERATOR_RETURN                                         

End of function xrange

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.88 ms | 1399 KiB | 14 Q