3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gen1() { $x = yield 1; $y = yield 2; var_dump($x + $y); } $g = gen1(); $g->next(); $g->send(20); $g->send(30);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/O1XUj
function name:  (null)
number of ops:  12
compiled vars:  !0 = $g
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'gen1'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   10     3        INIT_METHOD_CALL                                         !0, 'next'
          4        DO_FCALL                                      0          
   11     5        INIT_METHOD_CALL                                         !0, 'send'
          6        SEND_VAL_EX                                              20
          7        DO_FCALL                                      0          
   12     8        INIT_METHOD_CALL                                         !0, 'send'
          9        SEND_VAL_EX                                              30
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

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

End of function gen1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.57 ms | 1398 KiB | 16 Q