11
msdsk
4y

AAAAAH why does array_filter in php not readjust indexes after removing elements holy fuck what the fuck is wrong with this language

Comments
  • 2
    there's array_splice() for just this occasion.

    And reindexing the array takes time... just dropping the index does not. So you can save some cycles if you don't care about the array's indexes.

    Also note unset() will not reindex.
  • 2
    Php enjoys your frustration.
  • 1
    PHP is powered exclusively by developer tears
Add Comment