array_merge returns darraynightly-2020.07.04nightly-2020.07.05nightly-2020.07.06
commitcd51cb4c1a69bd4b506d20c823e0605c0ec4bbd0
authorShaunak Kishore <kshaunak@fb.com>
Fri, 3 Jul 2020 21:17:23 +0000 (3 14:17 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 3 Jul 2020 21:19:36 +0000 (3 14:19 -0700)
tree2b4f3cf9ef3106ed14c3ccbde7f6a24f723c5263
parent6bf4f129654743fab5ef27b7308cac4bb4450b93
array_merge returns darray

Summary:
array_merge is still rather common in our code. I'm honestly not sure why we didn't do this one earlier.

The only real trick here is that we have to be "HAM-safe" - we need to return a dict post-HADVAs. We also can't change the typehint because of the null return case. (Both a ?darray and a darray typehint are valid here - HHVM expands array builtin return types to include null - but the problem is the use of the sneaky getCheckedContainer macro. I don't care to fix it.)

Reviewed By: ricklavoie

Differential Revision: D22371748

fbshipit-source-id: de67e62f9951e149240dc2809f5a3bda3fbee374
hphp/runtime/base/array-data-defs.h
hphp/runtime/base/mixed-array.cpp
hphp/runtime/base/packed-array.cpp
hphp/runtime/base/packed-array.h
hphp/runtime/ext/array/ext_array.cpp
hphp/runtime/test/array.cpp
hphp/test/server/fastcgi/Adoy/Client.php
hphp/test/slow/dv_array/array_merge.php.expect
hphp/test/slow/dv_array_hack_arr/array_merge.php.expect
hphp/test/slow/global_func/class_meth/dv_arr_hack_arr/container_builtins_convert_and_warn.php.expectf