Have array_shuffle return darrays
commit99e3cb9b04d223e5b1f2a65b2c6957d77d870882
authorShaunak Kishore <kshaunak@fb.com>
Fri, 22 May 2020 21:18:32 +0000 (22 14:18 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 22 May 2020 21:21:31 +0000 (22 14:21 -0700)
tree82b01613282210696a8192cc0ce5ab2b760bed53
parente50c8f50ce7fa9f1a446562e8ebe429b61fcaff8
Have array_shuffle return darrays

Summary:
With D21690810, array_shuffle preserves varrays but downgrades darrays to plain arrays. Let's just have it convert return darrays for both the darray and plain array case.

The reason I didn't initially do that is because of how array_shuffle is typed, but I think it's okay - the Hack typing is array_shuffle<Tv>(inout Container<Tv> $array), which this change still respects, so we're not introducing further type-checker unsoundness.

Reviewed By: dneiter

Differential Revision: D21703928

fbshipit-source-id: b7293a157eb86a6dd78c3b00ed0218b0c571cf6e
hphp/runtime/base/array-util.cpp