3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gen() { echo "Sup\n"; $x = yield from []; echo "Dawg\n"; echo "x is $x\n"; } $g = gen(); var_dump($g->current());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/88r2h
function name:  (null)
number of ops:  9
compiled vars:  !0 = $g
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'gen'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   11     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'current'
          5        DO_FCALL                                      0  $3      
          6        SEND_VAR                                                 $3
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function gen:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/88r2h
function name:  gen
number of ops:  10
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                         
    4     1        ECHO                                                     'Sup%0A'
    5     2        YIELD_FROM                                       ~1      <array>
          3        ASSIGN                                                   !0, ~1
    6     4        ECHO                                                     'Dawg%0A'
    7     5        ROPE_INIT                                     3  ~4      'x+is+'
          6        ROPE_ADD                                      1  ~4      ~4, !0
          7        ROPE_END                                      2  ~3      ~4, '%0A'
          8        ECHO                                                     ~3
    8     9      > GENERATOR_RETURN                                         

End of function gen

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.12 ms | 1397 KiB | 16 Q