Fix collection->hack array conversions
commit5c180bf544bac5f940cff13328388339363f3f1b
authorPaul Bissonnette <paulbiss@fb.com>
Wed, 21 Dec 2016 18:23:24 +0000 (21 10:23 -0800)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Wed, 21 Dec 2016 18:34:56 +0000 (21 10:34 -0800)
tree87298bbe14fa97882e82c4462dd77ae0db7c3b1c
parentcb64ab103e477fc948049cc234a0d56b072c637c
Fix collection->hack array conversions

Summary:
Using collections::toArray as an intermediate was causing us to convert intish
string keys to int keys. For dict this caused us to do weak key conversions
when converting collections to dicts. For keysets and vecs if the original
collection contained an intish string key and an int key with the same value
we would raise a notice and lose one of the values.

Reviewed By: ricklavoie

Differential Revision: D4355103

fbshipit-source-id: 34f2532cb654179595669ecb06ca5db59d6bc89f
hphp/runtime/base/tv-helpers.cpp
hphp/runtime/ext/array/ext_array.cpp
hphp/runtime/vm/jit/translator-runtime.cpp
hphp/test/slow/dict/to-dict.php
hphp/test/slow/dict/to-dict.php.expect
hphp/test/slow/keyset/to-keyset.php
hphp/test/slow/keyset/to-keyset.php.expect
hphp/test/slow/vec/to-vec.php
hphp/test/slow/vec/to-vec.php.expect