3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test() { echo 1; yield 1; echo 2; yield 2; echo 3; yield 3; echo 4; yield 4; } $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/RkitW
function name:  (null)
number of ops:  17
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'test'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   17     3        INIT_METHOD_CALL                                         !0, 'send'
          4        SEND_VAL_EX                                              ''
          5        DO_FCALL                                      0          
   18     6        INIT_METHOD_CALL                                         !0, 'current'
          7        DO_FCALL                                      0          
   19     8        INIT_METHOD_CALL                                         !0, 'send'
          9        SEND_VAL_EX                                              ''
         10        DO_FCALL                                      0          
   21    11        INIT_METHOD_CALL                                         !0, 'current'
         12        DO_FCALL                                      0          
   22    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/RkitW
function name:  test
number of ops:  10
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
    8     4        YIELD                                                    2
    9     5        ECHO                                                     3
   10     6        YIELD                                                    3
   11     7        ECHO                                                     4
   12     8        YIELD                                                    4
   14     9      > GENERATOR_RETURN                                         

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.03 ms | 1398 KiB | 14 Q