3v4l.org

run code in 300+ PHP versions simultaneously
<?php function helloWorld() { yield from ['Hello', 'World']; } function genX() { $gen = helloWorld(); yield $gen; } $genii = genX(); echo $genii;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b2dFL
function name:  (null)
number of ops:  5
compiled vars:  !0 = $genii
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'genx'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   13     3        ECHO                                                     !0
   14     4      > RETURN                                                   1

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

End of function helloworld

Function genx:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/b2dFL
function name:  genX
number of ops:  6
compiled vars:  !0 = $gen
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   GENERATOR_CREATE                                         
    8     1        INIT_FCALL                                               'helloworld'
          2        DO_FCALL                                      0  $1      
          3        ASSIGN                                                   !0, $1
    9     4        YIELD                                                    !0
   10     5      > GENERATOR_RETURN                                         

End of function genx

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.72 ms | 1397 KiB | 15 Q