title: PHP array_merge: argument not an array?
body: <p>I'm getting some weird behaviour in PHP that I just can't understand.</p>
  
  <pre><code>    $count=0;
      $temp=array(); //this is definitely a new variable, not that it should matter
      foreach($array as $arr) {
          if ($arr-&gt;bbcode != $previous_bb) {
              $previous_bb=$arr-&gt;bbcode; 
              //stuff
              $temp=array_merge($temp,$arr);
           }
       //stuff
      }
  </code></pre>
  
  <p>I've tried to simplify the code a little and just keep what's essential. $array is a 2-D array (so each $arr has some attributes like the bbcode that you see). It complains that argument 1, i.e. $temp, is not an array. Typecasting it to array gives bogus results. Of course, this is within other code, which I can give more details of if needed, but any ideas? I've used the exact same sort of code and syntax in other places and it doesn't complain...</p>
  
  <p>EDIT: Feel free to downvote liberally, had a memory lapse about what I had been working with and how I'd been doing things. Never had to ask a programming question before (in several years), thanks a ton guys, you are immensely fast! </p>