3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test() { $n = 1; //while (true) { $x = yield; echo $x; echo $n; $n++; $x = yield; echo $x; echo $n; $n++; $x = yield; echo $x; echo $n; $n++; //} } $test = test(); $test('A'); $test('B'); $test('C');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/U0QPF
function name:  (null)
number of ops:  13
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_FCALL                                               'test'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   25     3        INIT_DYNAMIC_CALL                                        !0
          4        SEND_VAL_EX                                              'A'
          5        DO_FCALL                                      0          
   26     6        INIT_DYNAMIC_CALL                                        !0
          7        SEND_VAL_EX                                              'B'
          8        DO_FCALL                                      0          
   27     9        INIT_DYNAMIC_CALL                                        !0
         10        SEND_VAL_EX                                              'C'
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/U0QPF
function name:  test
number of ops:  18
compiled vars:  !0 = $n, !1 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                         
    5     1        ASSIGN                                                   !0, 1
    7     2        YIELD                                            $3      
          3        ASSIGN                                                   !1, $3
    8     4        ECHO                                                     !1
    9     5        ECHO                                                     !0
   10     6        PRE_INC                                                  !0
   12     7        YIELD                                            $6      
          8        ASSIGN                                                   !1, $6
   13     9        ECHO                                                     !1
   14    10        ECHO                                                     !0
   15    11        PRE_INC                                                  !0
   17    12        YIELD                                            $9      
         13        ASSIGN                                                   !1, $9
   18    14        ECHO                                                     !1
   19    15        ECHO                                                     !0
   20    16        PRE_INC                                                  !0
   22    17      > GENERATOR_RETURN                                         

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.51 ms | 1399 KiB | 14 Q