fork(1) download
  1. <?php
  2.  
  3.  
  4. $filled = array();
  5. $fillingUp = array (1, 2, 3);
  6. for ($i = 0; $i <= 5; $i++) {
  7. $filled = array_fill($i, $i, $fillingUp);
  8. }
  9. var_dump($filled);
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
array(5) {
  [5]=>
  array(3) {
    [0]=>
    int(1)
    [1]=>
    int(2)
    [2]=>
    int(3)
  }
  [6]=>
  array(3) {
    [0]=>
    int(1)
    [1]=>
    int(2)
    [2]=>
    int(3)
  }
  [7]=>
  array(3) {
    [0]=>
    int(1)
    [1]=>
    int(2)
    [2]=>
    int(3)
  }
  [8]=>
  array(3) {
    [0]=>
    int(1)
    [1]=>
    int(2)
    [2]=>
    int(3)
  }
  [9]=>
  array(3) {
    [0]=>
    int(1)
    [1]=>
    int(2)
    [2]=>
    int(3)
  }
}