3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = function () { yield from range('a', 'z'); }; $b = function () use ($a) { yield from $a(); }; foreach ($b() as $i => $v) { echo "$i: $v\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 16
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/3AqJb
function name:  (null)
number of ops:  18
compiled vars:  !0 = $a, !1 = $b, !2 = $v, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F3AqJb%3A3%240'
          1        ASSIGN                                                   !0, ~4
    6     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F3AqJb%3A6%241'
          3        BIND_LEXICAL                                             ~6, !0
          4        ASSIGN                                                   !1, ~6
   10     5        INIT_DYNAMIC_CALL                                        !1
          6        DO_FCALL                                      0  $8      
          7      > FE_RESET_R                                       $9      $8, ->16
          8    > > FE_FETCH_R                                       ~10     $9, !2, ->16
          9    >   ASSIGN                                                   !3, ~10
   11    10        ROPE_INIT                                     4  ~13     !3
         11        ROPE_ADD                                      1  ~13     ~13, '%3A+'
         12        ROPE_ADD                                      2  ~13     ~13, !2
         13        ROPE_END                                      3  ~12     ~13, '%0A'
         14        ECHO                                                     ~12
   10    15      > JMP                                                      ->8
         16    >   FE_FREE                                                  $9
   12    17      > RETURN                                                   1

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

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

Function %00%7Bclosure%7D%2Fin%2F3AqJb%3A6%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/3AqJb
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   GENERATOR_CREATE                                         
          1        BIND_STATIC                                              !0
    7     2        INIT_DYNAMIC_CALL                                        !0
          3        DO_FCALL                                      0  $1      
          4        YIELD_FROM                                       ~2      $1
          5        FREE                                                     ~2
    8     6      > GENERATOR_RETURN                                         

End of function %00%7Bclosure%7D%2Fin%2F3AqJb%3A6%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.89 ms | 1404 KiB | 15 Q