3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test() { echo '1' . yield . '|'; echo '2' . yield . '|'; } $val = test(); var_dump($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/MB3Ot
function name:  (null)
number of ops:  15
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
   10     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'current'
          5        DO_FCALL                                      0  $3      
          6        SEND_VAR                                                 $3
          7        DO_ICALL                                                 
   11     8        INIT_METHOD_CALL                                         !0, 'send'
          9        SEND_VAL_EX                                              'ok'
         10        DO_FCALL                                      0          
   12    11        INIT_METHOD_CALL                                         !0, 'send'
         12        SEND_VAL_EX                                              'ok'
         13        DO_FCALL                                      0          
   20    14      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/MB3Ot
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:
155 ms | 1398 KiB | 16 Q