3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gen() : \Generator { $str = ''; while (FALSE !== $v = yield) { $str .= $v; } print "$str\n"; } $gen = gen(); $gen->send('Hello'); $gen->send(' '); $gen->send('world'); $gen->send(FALSE);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gcKD7
function name:  (null)
number of ops:  16
compiled vars:  !0 = $gen
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'gen'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   12     3        INIT_METHOD_CALL                                         !0, 'send'
          4        SEND_VAL_EX                                              'Hello'
          5        DO_FCALL                                      0          
   13     6        INIT_METHOD_CALL                                         !0, 'send'
          7        SEND_VAL_EX                                              '+'
          8        DO_FCALL                                      0          
   14     9        INIT_METHOD_CALL                                         !0, 'send'
         10        SEND_VAL_EX                                              'world'
         11        DO_FCALL                                      0          
   15    12        INIT_METHOD_CALL                                         !0, 'send'
         13        SEND_VAL_EX                                              <false>
         14        DO_FCALL                                      0          
         15      > RETURN                                                   1

Function gen:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 3
Branch analysis from position: 8
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 3
Branch analysis from position: 8
Branch analysis from position: 3
filename:       /in/gcKD7
function name:  gen
number of ops:  12
compiled vars:  !0 = $str, !1 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                         
    4     1        ASSIGN                                                   !0, ''
    5     2      > JMP                                                      ->4
    6     3    >   ASSIGN_OP                                     8          !0, !1
    5     4    >   YIELD                                            $4      
          5        ASSIGN                                           ~5      !1, $4
          6        TYPE_CHECK                                  1018          ~5
          7      > JMPNZ                                                    ~6, ->3
    8     8    >   NOP                                                      
          9        FAST_CONCAT                                      ~7      !0, '%0A'
         10        ECHO                                                     ~7
    9    11      > GENERATOR_RETURN                                         

End of function gen

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.22 ms | 1399 KiB | 14 Q