3v4l.org

run code in 300+ PHP versions simultaneously
<?php $gen = (function () { yield from range('a', 'z'); })(); $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 = 6, Position 2 = 15
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 14
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 23
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 23
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
Branch analysis from position: 23
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 15
Branch analysis from position: 15
filename:       /in/u9LpT
function name:  (null)
number of ops:  25
compiled vars:  !0 = $gen, !1 = $c, !2 = $v, !3 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fu9LpT%3A3%240'
          1        INIT_DYNAMIC_CALL                                        ~4
          2        DO_FCALL                                      0  $5      
          3        ASSIGN                                                   !0, $5
    5     4        ASSIGN                                                   !1, 0
    6     5      > FE_RESET_R                                       $8      !0, ->15
          6    > > FE_FETCH_R                                       ~9      $8, !2, ->15
          7    >   ASSIGN                                                   !3, ~9
    7     8        CONCAT                                           ~11     !2, '%0A'
          9        ECHO                                                     ~11
    8    10        POST_INC                                         ~12     !1
         11        IS_SMALLER                                               2, ~12
         12      > JMPZ                                                     ~13, ->14
    9    13    > > JMP                                                      ->15
    6    14    > > JMP                                                      ->6
         15    >   FE_FREE                                                  $8
   13    16      > FE_RESET_R                                       $14     !0, ->23
         17    > > FE_FETCH_R                                       ~15     $14, !2, ->23
         18    >   ASSIGN                                                   !3, ~15
   14    19        CONCAT                                           ~17     !2, '%0A'
         20        ECHO                                                     ~17
   15    21      > JMP                                                      ->23
   13    22*       JMP                                                      ->17
         23    >   FE_FREE                                                  $14
   16    24      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fu9LpT%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/u9LpT
function name:  {closure}
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                         
          1        INIT_FCALL                                               'range'
          2        SEND_VAL                                                 'a'
          3        SEND_VAL                                                 'z'
          4        DO_ICALL                                         $0      
          5        YIELD_FROM                                       ~1      $0
          6        FREE                                                     ~1
          7      > GENERATOR_RETURN                                         

End of function %00%7Bclosure%7D%2Fin%2Fu9LpT%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.38 ms | 1400 KiB | 15 Q