3v4l.org

run code in 300+ PHP versions simultaneously
<?php // $gen = (function () { yield from range('a', 'z'); })(); function xrange() { foreach (range('a','z') as $l) yield $l; } $gen = xrange(); $c = 0; foreach ($gen as $k => $v) { echo $v . PHP_EOL; if ($c++ > 2) { break; } } foreach ($gen as $k => $v) { echo $v . PHP_EOL; break; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 14
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 14
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 22
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 22
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
Branch analysis from position: 22
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 14
Branch analysis from position: 14
filename:       /in/Zs7Hi
function name:  (null)
number of ops:  24
compiled vars:  !0 = $gen, !1 = $c, !2 = $v, !3 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'xrange'
          1        DO_FCALL                                      0  $4      
          2        ASSIGN                                                   !0, $4
    9     3        ASSIGN                                                   !1, 0
   10     4      > FE_RESET_R                                       $7      !0, ->14
          5    > > FE_FETCH_R                                       ~8      $7, !2, ->14
          6    >   ASSIGN                                                   !3, ~8
   11     7        CONCAT                                           ~10     !2, '%0A'
          8        ECHO                                                     ~10
   12     9        POST_INC                                         ~11     !1
         10        IS_SMALLER                                               2, ~11
         11      > JMPZ                                                     ~12, ->13
   13    12    > > JMP                                                      ->14
   10    13    > > JMP                                                      ->5
         14    >   FE_FREE                                                  $7
   17    15      > FE_RESET_R                                       $13     !0, ->22
         16    > > FE_FETCH_R                                       ~14     $13, !2, ->22
         17    >   ASSIGN                                                   !3, ~14
   18    18        CONCAT                                           ~16     !2, '%0A'
         19        ECHO                                                     ~16
   19    20      > JMP                                                      ->22
   17    21*       JMP                                                      ->16
         22    >   FE_FREE                                                  $13
   20    23      > RETURN                                                   1

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

End of function xrange

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.97 ms | 1407 KiB | 16 Q