3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr = [1,2,3]; function a($x){ yield from $x; } foreach(a(a($arr)) as $x){ print_r($x); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/2ZQ8d
function name:  (null)
number of ops:  15
compiled vars:  !0 = $arr, !1 = $x
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
    9     1        INIT_FCALL                                                   'a'
          2        INIT_FCALL                                                   'a'
          3        SEND_VAR                                                     !0
          4        DO_FCALL                                          0  $3      
          5        SEND_VAR                                                     $3
          6        DO_FCALL                                          0  $4      
          7      > FE_RESET_R                                           $5      $4, ->13
          8    > > FE_FETCH_R                                                   $5, !1, ->13
   10     9    >   INIT_FCALL                                                   'print_r'
         10        SEND_VAR                                                     !1
         11        DO_ICALL                                                     
    9    12      > JMP                                                          ->8
         13    >   FE_FREE                                                      $5
   11    14      > RETURN                                                       1

Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/2ZQ8d
function name:  a
number of ops:  5
compiled vars:  !0 = $x
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
          1        GENERATOR_CREATE                                             
    5     2        YIELD_FROM                                           ~1      !0
          3        FREE                                                         ~1
    6     4      > GENERATOR_RETURN                                             

End of function a

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
166.04 ms | 2096 KiB | 16 Q