Eliminate PackedArrayInit in extensions
commit2858ac516b966a92e44035d8e6705fc16e4e8ec7
authorShaunak Kishore <kshaunak@fb.com>
Fri, 22 May 2020 10:41:25 +0000 (22 03:41 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 22 May 2020 10:53:28 +0000 (22 03:53 -0700)
treed4d6cbcd5844e3b726d28b29a5a620db9d38863d
parent04a732dc8e04e4b9678867d50d11af47b8b6c3f3
Eliminate PackedArrayInit in extensions

Summary:
On the continuing quest to eliminate EmptyArray and plain PackedArrays...

Most extension usages of PackedArrayInit / make_packed_array can be converted over to VArrayInit instead. This change is safe other than (possibly) introducing new notices. Here are the exceptions:
1. array_slice doesn't touch string keys in the array. If there may be some, we use a darray.
2. In ext_collections-pair, ToPHPArray must return a plain array (runtime requirement) so we return a MixedArray.

Reviewed By: dneiter

Differential Revision: D21699243

fbshipit-source-id: 6eb21519a88f81aa6d88f6e1bc029c37b6af0b0f
14 files changed:
hphp/runtime/debugger/debugger_client.cpp
hphp/runtime/ext/array/ext_array.cpp
hphp/runtime/ext/collections/ext_collections-pair.cpp
hphp/runtime/ext/curl/curl-resource.cpp
hphp/runtime/ext/gmp/ext_gmp.cpp
hphp/runtime/ext/libxml/ext_libxml.cpp
hphp/runtime/ext/libxml/ext_libxml.php
hphp/runtime/ext/mbstring/ext_mbstring.cpp
hphp/runtime/ext/soap/ext_soap.cpp
hphp/runtime/ext/std/ext_std_intrinsics.cpp
hphp/runtime/ext/std/ext_std_process.cpp
hphp/runtime/ext/string/ext_string.cpp
hphp/runtime/ext/string/ext_string.php
hphp/test/slow/global_func/class_meth/dv_arr_hack_arr/container_builtins_convert_and_warn.php.expectf