3v4l.org

run code in 300+ PHP versions simultaneously
<?php function dataSource() { $rowsYielded = 0; while($rowsYielded++ < 10) { yield array('id' => $rowsYielded, 'column' => 'large value', 'another_column' => 'shazaam'); } } foreach(dataSource() as $row) { // DB::table('...')->insert($row) var_dump($row['id']); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 9
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/udf4S
function name:  (null)
number of ops:  11
compiled vars:  !0 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'datasource'
          1        DO_FCALL                                      0  $1      
          2      > FE_RESET_R                                       $2      $1, ->9
          3    > > FE_FETCH_R                                               $2, !0, ->9
   12     4    >   INIT_FCALL                                               'var_dump'
          5        FETCH_DIM_R                                      ~3      !0, 'id'
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                                 
   10     8      > JMP                                                      ->3
          9    >   FE_FREE                                                  $2
   13    10      > RETURN                                                   1

Function datasource:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
Branch analysis from position: 3
filename:       /in/udf4S
function name:  dataSource
number of ops:  11
compiled vars:  !0 = $rowsYielded
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                         
    4     1        ASSIGN                                                   !0, 0
    5     2      > JMP                                                      ->7
    6     3    >   INIT_ARRAY                                       ~2      !0, 'id'
          4        ADD_ARRAY_ELEMENT                                ~2      'large+value', 'column'
          5        ADD_ARRAY_ELEMENT                                ~2      'shazaam', 'another_column'
          6        YIELD                                                    ~2
    5     7    >   POST_INC                                         ~4      !0
          8        IS_SMALLER                                               ~4, 10
          9      > JMPNZ                                                    ~5, ->3
    8    10    > > GENERATOR_RETURN                                         

End of function datasource

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.64 ms | 1436 KiB | 15 Q