3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fetch($sth, $fetchMode) { while ($result = test()) { yield $result; } } function test() { return [ 1,2,3,4,5 ]; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eRGLP
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E > > RETURN                                                   1

Function fetch:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 4
Branch analysis from position: 9
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 4
Branch analysis from position: 9
Branch analysis from position: 4
filename:       /in/eRGLP
function name:  fetch
number of ops:  10
compiled vars:  !0 = $sth, !1 = $fetchMode, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        GENERATOR_CREATE                                         
    4     3      > JMP                                                      ->5
    5     4    >   YIELD                                                    !2
    4     5    >   INIT_FCALL_BY_NAME                                       'test'
          6        DO_FCALL                                      0  $4      
          7        ASSIGN                                           ~5      !2, $4
          8      > JMPNZ                                                    ~5, ->4
    7     9    > > GENERATOR_RETURN                                         

End of function fetch

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eRGLP
function name:  test
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E > > RETURN                                                   <array>
   13     1*     > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.17 ms | 1394 KiB | 13 Q