3v4l.org

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

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

End of function printer

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.33 ms | 1389 KiB | 16 Q