3v4l.org

run code in 300+ PHP versions simultaneously
<?php function setArgs(Generator $args) { $value = $args->send(1); var_dump("got back $value"); } function genArgs() { var_dump("received ".(yield "a")); } $g = genArgs(); setArgs($g);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G7Ya3
function name:  (null)
number of ops:  7
compiled vars:  !0 = $g
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'genargs'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   13     3        INIT_FCALL                                               'setargs'
          4        SEND_VAR                                                 !0
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function setargs:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G7Ya3
function name:  setArgs
number of ops:  11
compiled vars:  !0 = $args, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_METHOD_CALL                                         !0, 'send'
          2        SEND_VAL_EX                                              1
          3        DO_FCALL                                      0  $2      
          4        ASSIGN                                                   !1, $2
    5     5        INIT_FCALL                                               'var_dump'
          6        NOP                                                      
          7        FAST_CONCAT                                      ~4      'got+back+', !1
          8        SEND_VAL                                                 ~4
          9        DO_ICALL                                                 
    6    10      > RETURN                                                   null

End of function setargs

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

End of function genargs

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.43 ms | 1390 KiB | 17 Q