title: PHP Fatal error: Uncaught Error: Unsupported operand types when adding values to array
body: <p>I get an error when trying to rebuild an array with below code:</p>
  
  <blockquote>
    <p>PHP Fatal error: Uncaught Error: Unsupported operand types</p>
  </blockquote>
  
  <pre><code>$id = '9242';
  $supergroup = array('9242' =&gt; 1, '9243' =&gt; 0, '9244' =&gt; 2, '9245' =&gt; 0);
  $supergroupnew = [];
  
  array_walk_recursive($supergroup, function($item, $key) use(&amp;$id) {
      if ($key == $id) {
          $supergroupnew += [ $key =&gt; $item ];
      } else {
          $supergroupnew += [ $key =&gt; "0" ];
      }
  });
  
  echo "&lt;h1&gt;Original Array:&lt;/h1&gt;";
  print_r($supergroup);   
  
  echo "&lt;h1&gt;New Array:&lt;/h1&gt;";
  print_r($supergroupnew);
  </code></pre>
  
  <p>Other answers suggest that I am trying to do some arithmetic on an array however I cannot see this in the above code.</p>