3v4l.org

run code in 500+ PHP versions simultaneously
<?php $db_rows = [ ['id' => 1, 'title' => 'test', 'number' => 2, 'desc' => 'test'], ['id' => 2, 'title' => 'test2', 'number' => 3, 'desc' => 'test2'], ['id' => 3, 'title' => 'test3', 'number' => 1, 'desc' => 'test3'], ]; $clone_db_rows = []; foreach( $db_rows as $key => $value ) { for ($i = 0; $i < $value['number']; $i++) { $clone_db_rows[] = $value; } } print_r($clone_db_rows);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 14
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 7
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 7
Branch analysis from position: 13
Branch analysis from position: 7
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/kLSUi
function name:  (null)
number of ops:  19
compiled vars:  !0 = $db_rows, !1 = $clone_db_rows, !2 = $value, !3 = $key, !4 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    9     1        ASSIGN                                                       !1, <array>
   11     2      > FE_RESET_R                                           $7      !0, ->14
          3    > > FE_FETCH_R                                           ~8      $7, !2, ->14
          4    >   ASSIGN                                                       !3, ~8
   13     5        ASSIGN                                                       !4, 0
          6      > JMP                                                          ->10
   14     7    >   ASSIGN_DIM                                                   !1
          8        OP_DATA                                                      !2
   13     9        PRE_INC                                                      !4
         10    >   FETCH_DIM_R                                          ~13     !2, 'number'
         11        IS_SMALLER                                                   !4, ~13
         12      > JMPNZ                                                        ~14, ->7
   11    13    > > JMP                                                          ->3
         14    >   FE_FREE                                                      $7
   18    15        INIT_FCALL                                                   'print_r'
         16        SEND_VAR                                                     !1
         17        DO_ICALL                                                     
         18      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
216.32 ms | 2524 KiB | 13 Q