title: Arrays not merging together
body: <p>So I have the following two arrays which I try to merge together, the first one as $weekDays:</p>
  
  <pre><code>Array
  (
  [0] =&gt; Array
      (
          [id] =&gt; 1
          [start] =&gt; 11:00:00
          [end] =&gt; 17:00:00
      )
  
  [1] =&gt; Array
      (
          [id] =&gt; 2
          [start] =&gt; 09:00:00
          [end] =&gt; 17:00:00
      )
  
  [2] =&gt; Array
      (
          [id] =&gt; 3
          [start] =&gt; 09:00:00
          [end] =&gt; 17:00:00
      )
  
  [3] =&gt; Array
      (
          [id] =&gt; 5
          [start] =&gt; 09:00:00
          [end] =&gt; 17:00:00
      )
  
  [4] =&gt; Array
      (
          [id] =&gt; 6
          [start] =&gt; 09:00:00
          [end] =&gt; 17:00:00
      )
  
  [5] =&gt; Array
      (
          [id] =&gt; 7
          [start] =&gt; 09:00:00
          [end] =&gt; 17:00:00
      )
  
  [6] =&gt; Array
      (
          [id] =&gt; 8
          [start] =&gt; 09:00:00
          [end] =&gt; 17:00:00
      )
  
  )
  </code></pre>
  
  <p>And the second array as $all_slots:</p>
  
  <pre><code>Array
  (
      [0] =&gt; 0
      [1] =&gt; 0
      [2] =&gt; 2
      [3] =&gt; 0
      [4] =&gt; 0
      [5] =&gt; 0
      [6] =&gt; 0
      [7] =&gt; 0
  )
  </code></pre>
  
  <p>Using this foreach, I try to loop each $weekDays item and merge it with an $all_slots item which has te same index number:</p>
  
  <pre><code>foreach($weekDays as $index =&gt; $day){
          $slot = ['slot' =&gt; $all_slots[$index]];
          array_merge_recursive($slot, $day);
      }
  </code></pre>
  
  <p>But when I echo the updated $weekDays array it hasn't been merged at all, no errors either. It really does nothing for some reason, what am I missing here? I try to have the following result for the $weekDays array:</p>
  
  <pre><code>Array
  (
  [0] =&gt; Array
      (
          [id] =&gt; 1
          [start] =&gt; 11:00:00
          [end] =&gt; 17:00:00
          [slot] =&gt; 0
      )
  
  [1] =&gt; Array
      (
          [id] =&gt; 2
          [start] =&gt; 09:00:00
          [end] =&gt; 17:00:00
          [slot] =&gt; 0
      )
  
  [2] =&gt; Array
      (
          [id] =&gt; 3
          [start] =&gt; 09:00:00
          [end] =&gt; 17:00:00
          [slot] =&gt; 2
      )
  
  [3] =&gt; Array
      (
          [id] =&gt; 5
          [start] =&gt; 09:00:00
          [end] =&gt; 17:00:00
          [slot] =&gt; 0
      )
  
  [4] =&gt; Array
      (
          [id] =&gt; 6
          [start] =&gt; 09:00:00
          [end] =&gt; 17:00:00
          [slot] =&gt; 0
      )
  
  [5] =&gt; Array
      (
          [id] =&gt; 7
          [start] =&gt; 09:00:00
          [end] =&gt; 17:00:00
          [slot] =&gt; 0
      )
  
  [6] =&gt; Array
      (
          [id] =&gt; 8
          [start] =&gt; 09:00:00
          [end] =&gt; 17:00:00
          [slot] =&gt; 0
      )
  
  )
  </code></pre>