title: array_filter converting an indexed array to an associative array
body: <p>I have an indexed array that holds a few associative arrays and I apply a simple </p>
  
  <pre><code>$my_arr = array_filter($my_arr, function($obj) {
      return $obj["value"] &lt; 100;
  });
  </code></pre>
  
  <p>function to filter some of the items in the array.</p>
  
  <p>This started to make my Angular front end bug in weird ways, so after a few minutes I discovered that <code>$my_arr</code> was being converted from an indexed array to an associative array.</p>
  
  <ul>
  <li>Is this the expected behavior in <code>array_filter</code>?</li>
  <li>How can I tell <code>array_filter</code> that I want an indexed array?</li>
  </ul>
  
  <p>EDIT: As requested in the comments, my <code>$my_arr</code>:</p>
  
  <pre><code>$my_arr = [
      ["foo" =&gt; "bar", "value" =&gt; 10],
      ["foo" =&gt; "var", "value" =&gt; 30],
      ["foo" =&gt; "car", "value" =&gt; 440],
      ["foo" =&gt; "dar", "value" =&gt; 700]
  ]
  </code></pre>
  
  <p>EDIT: Real-world extract from my code:</p>
  
  <pre><code>$media = [
      "photos" =&gt; [
          ["foo" =&gt; "bar", "value" =&gt; 10],
          ["foo" =&gt; "var", "value" =&gt; 20],
          ["foo" =&gt; "car", "value" =&gt; 50],
      ]
  ];
  
  echo json_encode($media);
  echo "\n\n";
  
  $media["photos"] = array_filter($media["photos"], function($photo) {
      return $photo["value"] &gt; 15;
  });
  
  echo json_encode($media); 
  </code></pre>
  
  <p><b>Output:</b></p>
  
  <pre><code>{"photos":[{"foo":"bar","value":10},{"foo":"var","value":20},{"foo":"car","value":50}]}
  
  {"photos":{"1":{"foo":"var","value":20},"2":{"foo":"car","value":50}}}
  </code></pre>
  
  <p><b>Expected output:</b></p>
  
  <pre><code>{"photos":[{"foo":"bar","value":10},{"foo":"var","value":20},{"foo":"car","value":50}]}
  
  {"photos":[{"foo":"var","value":20},{"foo":"car","value":50}]}
  </code></pre>