3v4l.org

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

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

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.97 ms | 1398 KiB | 14 Q