3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test(array $array) { foreach ($array as $value) { yield $value; } } $array = range(0, 10000); $values = array(); foreach (test($array) as $value) { $values[] = $value; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/E94OS
function name:  (null)
number of ops:  16
compiled vars:  !0 = $array, !1 = $values, !2 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'range'
          1        SEND_VAL                                                 0
          2        SEND_VAL                                                 10000
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !0, $3
   11     5        ASSIGN                                                   !1, <array>
   13     6        INIT_FCALL                                               'test'
          7        SEND_VAR                                                 !0
          8        DO_FCALL                                      0  $6      
          9      > FE_RESET_R                                       $7      $6, ->14
         10    > > FE_FETCH_R                                               $7, !2, ->14
   14    11    >   ASSIGN_DIM                                               !1
         12        OP_DATA                                                  !2
   13    13      > JMP                                                      ->10
         14    >   FE_FREE                                                  $7
   15    15      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 6
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 6
filename:       /in/E94OS
function name:  test
number of ops:  8
compiled vars:  !0 = $array, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        GENERATOR_CREATE                                         
    4     2      > FE_RESET_R                                       $2      !0, ->6
          3    > > FE_FETCH_R                                               $2, !1, ->6
    5     4    >   YIELD                                                    !1
    4     5      > JMP                                                      ->3
          6    >   FE_FREE                                                  $2
    7     7      > GENERATOR_RETURN                                         

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.1 ms | 1403 KiB | 16 Q