3v4l.org

run code in 300+ PHP versions simultaneously
<?php $IDs = Array ( 0 => 86456, 1 => 83981, 2 => 3444, 3 => 2296, 4 => 21515, 5 => 66707, 6 => 20507, 7 => 66985, 8 => 78067, 9 => 10364 ); $number_of_seasons = Array ( 0 => 1, 1 => 1, 2 => 1, 3 => 1, 4 => 1, 5 => 3, 6 => 3, 7 => 1, 8 => 1, 9 => 1 ); $finalArray = []; foreach($IDs as $key=>$id){ $finalArray = array_merge($finalArray, array_fill (0, $number_of_seasons[$key], $id)); } print_r($finalArray);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 18
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 18
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/LDRS9
function name:  (null)
number of ops:  23
compiled vars:  !0 = $IDs, !1 = $number_of_seasons, !2 = $finalArray, !3 = $id, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   17     1        ASSIGN                                                   !1, <array>
   31     2        ASSIGN                                                   !2, <array>
   32     3      > FE_RESET_R                                       $8      !0, ->18
          4    > > FE_FETCH_R                                       ~9      $8, !3, ->18
          5    >   ASSIGN                                                   !4, ~9
   33     6        INIT_FCALL                                               'array_merge'
          7        SEND_VAR                                                 !2
          8        INIT_FCALL                                               'array_fill'
          9        SEND_VAL                                                 0
         10        FETCH_DIM_R                                      ~11     !1, !4
         11        SEND_VAL                                                 ~11
         12        SEND_VAR                                                 !3
         13        DO_ICALL                                         $12     
         14        SEND_VAR                                                 $12
         15        DO_ICALL                                         $13     
         16        ASSIGN                                                   !2, $13
   32    17      > JMP                                                      ->4
         18    >   FE_FREE                                                  $8
   36    19        INIT_FCALL                                               'print_r'
         20        SEND_VAR                                                 !2
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.89 ms | 1000 KiB | 16 Q