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('A'); test('B'); test('C');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sIVSn
function name:  (null)
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_FCALL                                               'test'
          1        DO_FCALL                                      0          
   25     2        INIT_FCALL                                               'test'
          3        SEND_VAL                                                 'A'
          4        DO_FCALL                                      0          
   26     5        INIT_FCALL                                               'test'
          6        SEND_VAL                                                 'B'
          7        DO_FCALL                                      0          
   27     8        INIT_FCALL                                               'test'
          9        SEND_VAL                                                 'C'
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

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