3v4l.org

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

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/lDRc5
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        YIELD                                            $0      
          2        CONCAT                                           ~1      '1', $0
          3        CONCAT                                           ~2      ~1, '%7C'
          4        ECHO                                                     ~2
    6     5        YIELD                                            $3      
          6        CONCAT                                           ~4      '2', $3
          7        CONCAT                                           ~5      ~4, '%7C'
          8        ECHO                                                     ~5
    7     9      > GENERATOR_RETURN                                         

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.88 ms | 1397 KiB | 14 Q