3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test() { $data = yield; echo $data; return "ahoj"; } $d = test(); var_dump($d); $d->send("Lukas"); var_dump($d);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/98VIe
function name:  (null)
number of ops:  13
compiled vars:  !0 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'test'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   15     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
   17     6        INIT_METHOD_CALL                                         !0, 'send'
          7        SEND_VAL_EX                                              'Lukas'
          8        DO_FCALL                                      0          
   19     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

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

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.83 ms | 1397 KiB | 16 Q