From d1979de61993b0224c6751e51fab7ceed68400a1 Mon Sep 17 00:00:00 2001 From: Shaunak Kishore Date: Mon, 20 Jul 2020 18:36:04 -0700 Subject: [PATCH] Eliminate ArrayData::plusEq Summary: Another PHPism down. This operation wasn't HAM-safe, and it was a little nuts to boot. There are two places that C++ code invoked this operator. In the debugger, we maintain the behavior by manual iteration. In ext_soap, we're listing available functions; there's a debugger command that does the same thing and assumes that system and user functions are disjoint, so maybe we can assume that too? Alternatively, I could just raise instead. Reviewed By: billf, dneiter Differential Revision: D22627817 fbshipit-source-id: 5a7a3ab3e097fcec8464301905e5d3c175999f48 --- hphp/doc/ir.specification | 4 - hphp/runtime/base/array-data-defs.h | 4 - hphp/runtime/base/array-data.cpp | 15 +-- hphp/runtime/base/array-data.h | 7 +- hphp/runtime/base/bespoke-array.cpp | 5 +- hphp/runtime/base/bespoke-array.h | 1 - hphp/runtime/base/bespoke/layout.h | 1 - hphp/runtime/base/bespoke/logging-array.cpp | 3 - hphp/runtime/base/bespoke/logging-array.h | 1 - hphp/runtime/base/mixed-array.cpp | 81 ---------------- hphp/runtime/base/mixed-array.h | 4 - hphp/runtime/base/packed-array.cpp | 23 ----- hphp/runtime/base/packed-array.h | 2 - hphp/runtime/base/set-array.cpp | 5 - hphp/runtime/base/set-array.h | 1 - hphp/runtime/base/tv-arith.cpp | 17 +--- hphp/runtime/base/type-array.cpp | 41 -------- hphp/runtime/base/type-array.h | 11 +-- hphp/runtime/debugger/cmd/cmd_info.cpp | 8 +- hphp/runtime/ext/soap/ext_soap.cpp | 7 +- hphp/runtime/test/array.cpp | 12 +-- hphp/runtime/vm/jit/dce.cpp | 1 - hphp/runtime/vm/jit/ir-opcode.cpp | 1 - hphp/runtime/vm/jit/irgen-arith.cpp | 29 ------ hphp/runtime/vm/jit/irlower-array.cpp | 2 - hphp/runtime/vm/jit/memory-effects.cpp | 1 - hphp/runtime/vm/jit/native-calls.cpp | 3 - hphp/runtime/vm/jit/translator-runtime.cpp | 26 ----- hphp/runtime/vm/jit/translator-runtime.h | 1 - hphp/test/quick/static-arr.php | 3 +- hphp/test/slow/array/220.php | 10 -- hphp/test/slow/array/220.php.expect | 4 - hphp/test/slow/array/220.php.hphp_opts | 1 - hphp/test/slow/array/220.php.opts | 1 - hphp/test/slow/array/221.php | 10 -- hphp/test/slow/array/221.php.expect | 6 -- hphp/test/slow/array/221.php.hphp_opts | 1 - hphp/test/slow/array/221.php.opts | 1 - hphp/test/slow/array/222.php | 10 -- hphp/test/slow/array/222.php.expect | 6 -- hphp/test/slow/array/222.php.hphp_opts | 1 - hphp/test/slow/array/222.php.opts | 1 - hphp/test/slow/array/223.php | 10 -- hphp/test/slow/array/223.php.expect | 6 -- hphp/test/slow/array/223.php.hphp_opts | 1 - hphp/test/slow/array/223.php.opts | 1 - hphp/test/slow/array/empty_array_009.php | 12 --- hphp/test/slow/array/empty_array_009.php.expect | 8 -- hphp/test/slow/array/internal-cursor-bug.php | 2 - .../test/slow/array/internal-cursor-bug.php.expect | 1 - hphp/test/slow/array_assignment/510.php | 19 ---- hphp/test/slow/array_assignment/510.php.expect | 22 ----- hphp/test/slow/array_escalation/368.php | 9 -- hphp/test/slow/array_escalation/368.php.expect | 2 - hphp/test/slow/array_escalation/369.php | 9 -- hphp/test/slow/array_escalation/369.php.expect | 4 - hphp/test/slow/array_escalation/370.php | 9 -- hphp/test/slow/array_escalation/370.php.expect | 4 - hphp/test/slow/array_escalation/371.php | 9 -- hphp/test/slow/array_escalation/371.php.expect | 7 -- hphp/test/slow/array_escalation/372.php | 9 -- hphp/test/slow/array_escalation/372.php.expect | 4 - hphp/test/slow/array_escalation/373.php | 9 -- hphp/test/slow/array_escalation/373.php.expect | 4 - hphp/test/slow/array_escalation/374.php | 9 -- hphp/test/slow/array_escalation/374.php.expect | 7 -- hphp/test/slow/array_escalation/375.php | 9 -- hphp/test/slow/array_escalation/375.php.expect | 4 - hphp/test/slow/array_escalation/376.php | 9 -- hphp/test/slow/array_escalation/376.php.expect | 4 - hphp/test/slow/array_escalation/377.php | 9 -- hphp/test/slow/array_escalation/377.php.expect | 4 - hphp/test/slow/array_escalation/378.php | 9 -- hphp/test/slow/array_escalation/378.php.expect | 4 - hphp/test/slow/array_escalation/379.php | 9 -- hphp/test/slow/array_escalation/379.php.expect | 6 -- hphp/test/slow/array_escalation/380.php | 9 -- hphp/test/slow/array_escalation/380.php.expect | 6 -- hphp/test/slow/array_escalation/381.php | 9 -- hphp/test/slow/array_escalation/381.php.expect | 9 -- hphp/test/slow/array_escalation/382.php | 9 -- hphp/test/slow/array_escalation/382.php.expect | 4 - hphp/test/slow/array_escalation/383.php | 9 -- hphp/test/slow/array_escalation/383.php.expect | 4 - hphp/test/slow/array_escalation/384.php | 9 -- hphp/test/slow/array_escalation/384.php.expect | 4 - hphp/test/slow/array_escalation/385.php | 9 -- hphp/test/slow/array_escalation/385.php.expect | 4 - hphp/test/slow/array_escalation/386.php | 9 -- hphp/test/slow/array_escalation/386.php.expect | 6 -- hphp/test/slow/array_escalation/387.php | 9 -- hphp/test/slow/array_escalation/387.php.expect | 6 -- hphp/test/slow/array_escalation/388.php | 9 -- hphp/test/slow/array_escalation/388.php.expect | 9 -- hphp/test/slow/array_escalation/389.php | 9 -- hphp/test/slow/array_escalation/389.php.expect | 7 -- hphp/test/slow/array_escalation/390.php | 9 -- hphp/test/slow/array_escalation/390.php.expect | 7 -- hphp/test/slow/array_escalation/391.php | 9 -- hphp/test/slow/array_escalation/391.php.expect | 7 -- hphp/test/slow/array_escalation/392.php | 9 -- hphp/test/slow/array_escalation/392.php.expect | 7 -- hphp/test/slow/array_escalation/393.php | 9 -- hphp/test/slow/array_escalation/393.php.expect | 9 -- hphp/test/slow/array_escalation/394.php | 9 -- hphp/test/slow/array_escalation/394.php.expect | 9 -- hphp/test/slow/array_escalation/395.php | 9 -- hphp/test/slow/array_escalation/395.php.expect | 12 --- hphp/test/slow/array_escalation/396.php | 9 -- hphp/test/slow/array_escalation/396.php.expect | 4 - hphp/test/slow/array_escalation/397.php | 9 -- hphp/test/slow/array_escalation/397.php.expect | 6 -- hphp/test/slow/array_escalation/398.php | 9 -- hphp/test/slow/array_escalation/398.php.expect | 6 -- hphp/test/slow/array_escalation/399.php | 9 -- hphp/test/slow/array_escalation/399.php.expect | 9 -- hphp/test/slow/array_escalation/400.php | 9 -- hphp/test/slow/array_escalation/400.php.expect | 6 -- hphp/test/slow/array_escalation/401.php | 9 -- hphp/test/slow/array_escalation/401.php.expect | 6 -- hphp/test/slow/array_escalation/402.php | 9 -- hphp/test/slow/array_escalation/402.php.expect | 9 -- hphp/test/slow/array_escalation/403.php | 9 -- hphp/test/slow/array_escalation/403.php.expect | 4 - hphp/test/slow/array_escalation/404.php | 9 -- hphp/test/slow/array_escalation/404.php.expect | 6 -- hphp/test/slow/array_escalation/405.php | 9 -- hphp/test/slow/array_escalation/405.php.expect | 6 -- hphp/test/slow/array_escalation/406.php | 9 -- hphp/test/slow/array_escalation/406.php.expect | 9 -- hphp/test/slow/array_escalation/407.php | 9 -- hphp/test/slow/array_escalation/407.php.expect | 6 -- hphp/test/slow/array_escalation/408.php | 9 -- hphp/test/slow/array_escalation/408.php.expect | 6 -- hphp/test/slow/array_escalation/409.php | 9 -- hphp/test/slow/array_escalation/409.php.expect | 9 -- hphp/test/slow/array_escalation/410.php | 9 -- hphp/test/slow/array_escalation/410.php.expect | 7 -- hphp/test/slow/array_escalation/411.php | 9 -- hphp/test/slow/array_escalation/411.php.expect | 9 -- hphp/test/slow/array_escalation/412.php | 9 -- hphp/test/slow/array_escalation/412.php.expect | 9 -- hphp/test/slow/array_escalation/413.php | 9 -- hphp/test/slow/array_escalation/413.php.expect | 12 --- hphp/test/slow/array_escalation/414.php | 9 -- hphp/test/slow/array_escalation/414.php.expect | 9 -- hphp/test/slow/array_escalation/415.php | 9 -- hphp/test/slow/array_escalation/415.php.expect | 9 -- hphp/test/slow/array_escalation/416.php | 9 -- hphp/test/slow/array_escalation/416.php.expect | 12 --- hphp/test/slow/compilation/1297.php | 7 -- hphp/test/slow/compilation/1297.php.expect | 8 -- hphp/test/slow/ext_apc/4.php | 4 +- hphp/test/slow/ext_array/array_merge.php | 2 +- hphp/test/slow/ext_array/array_merge.php.expect | 2 +- hphp/test/slow/ext_array/array_replace.php | 2 +- hphp/test/slow/ext_array/array_replace.php.expect | 2 +- hphp/test/slow/hack_arr_compat/add.php | 2 +- hphp/test/slow/hack_arr_compat/add.php.expectf | 38 +------- hphp/test/slow/hack_arr_compat/scalars.php | 6 -- hphp/test/slow/hack_arr_compat/scalars.php.expectf | 28 ------ .../slow/hack_arr_compat/split_misc_notices.php | 6 +- .../hack_arr_compat/split_misc_notices.php.expectf | 11 +-- .../slow/hack_arr_compat/split_misc_notices_2.php | 6 +- .../split_misc_notices_2.php.expectf | 13 +-- hphp/test/slow/hack_array_pluseq.php | 59 ------------ hphp/test/slow/hack_array_pluseq.php.expect | 24 ----- .../slow/ir_inlining/nested-calls-redefsp-1.php | 2 +- .../slow/php7_backported/varSyntax/issetOnTemp.php | 8 +- .../additive_operators/array_concatenation.php | 61 ------------ .../array_concatenation.php.expectf | 107 --------------------- hphp/test/zend/good/Zend/tests/add_001.php | 28 ------ hphp/test/zend/good/Zend/tests/add_001.php.expectf | 41 -------- 173 files changed, 52 insertions(+), 1633 deletions(-) delete mode 100644 hphp/test/slow/array/220.php delete mode 100644 hphp/test/slow/array/220.php.expect delete mode 100644 hphp/test/slow/array/220.php.hphp_opts delete mode 120000 hphp/test/slow/array/220.php.opts delete mode 100644 hphp/test/slow/array/221.php delete mode 100644 hphp/test/slow/array/221.php.expect delete mode 100644 hphp/test/slow/array/221.php.hphp_opts delete mode 120000 hphp/test/slow/array/221.php.opts delete mode 100644 hphp/test/slow/array/222.php delete mode 100644 hphp/test/slow/array/222.php.expect delete mode 100644 hphp/test/slow/array/222.php.hphp_opts delete mode 120000 hphp/test/slow/array/222.php.opts delete mode 100644 hphp/test/slow/array/223.php delete mode 100644 hphp/test/slow/array/223.php.expect delete mode 100644 hphp/test/slow/array/223.php.hphp_opts delete mode 120000 hphp/test/slow/array/223.php.opts delete mode 100644 hphp/test/slow/array/empty_array_009.php delete mode 100644 hphp/test/slow/array/empty_array_009.php.expect delete mode 100644 hphp/test/slow/array_assignment/510.php delete mode 100644 hphp/test/slow/array_assignment/510.php.expect delete mode 100644 hphp/test/slow/array_escalation/368.php delete mode 100644 hphp/test/slow/array_escalation/368.php.expect delete mode 100644 hphp/test/slow/array_escalation/369.php delete mode 100644 hphp/test/slow/array_escalation/369.php.expect delete mode 100644 hphp/test/slow/array_escalation/370.php delete mode 100644 hphp/test/slow/array_escalation/370.php.expect delete mode 100644 hphp/test/slow/array_escalation/371.php delete mode 100644 hphp/test/slow/array_escalation/371.php.expect delete mode 100644 hphp/test/slow/array_escalation/372.php delete mode 100644 hphp/test/slow/array_escalation/372.php.expect delete mode 100644 hphp/test/slow/array_escalation/373.php delete mode 100644 hphp/test/slow/array_escalation/373.php.expect delete mode 100644 hphp/test/slow/array_escalation/374.php delete mode 100644 hphp/test/slow/array_escalation/374.php.expect delete mode 100644 hphp/test/slow/array_escalation/375.php delete mode 100644 hphp/test/slow/array_escalation/375.php.expect delete mode 100644 hphp/test/slow/array_escalation/376.php delete mode 100644 hphp/test/slow/array_escalation/376.php.expect delete mode 100644 hphp/test/slow/array_escalation/377.php delete mode 100644 hphp/test/slow/array_escalation/377.php.expect delete mode 100644 hphp/test/slow/array_escalation/378.php delete mode 100644 hphp/test/slow/array_escalation/378.php.expect delete mode 100644 hphp/test/slow/array_escalation/379.php delete mode 100644 hphp/test/slow/array_escalation/379.php.expect delete mode 100644 hphp/test/slow/array_escalation/380.php delete mode 100644 hphp/test/slow/array_escalation/380.php.expect delete mode 100644 hphp/test/slow/array_escalation/381.php delete mode 100644 hphp/test/slow/array_escalation/381.php.expect delete mode 100644 hphp/test/slow/array_escalation/382.php delete mode 100644 hphp/test/slow/array_escalation/382.php.expect delete mode 100644 hphp/test/slow/array_escalation/383.php delete mode 100644 hphp/test/slow/array_escalation/383.php.expect delete mode 100644 hphp/test/slow/array_escalation/384.php delete mode 100644 hphp/test/slow/array_escalation/384.php.expect delete mode 100644 hphp/test/slow/array_escalation/385.php delete mode 100644 hphp/test/slow/array_escalation/385.php.expect delete mode 100644 hphp/test/slow/array_escalation/386.php delete mode 100644 hphp/test/slow/array_escalation/386.php.expect delete mode 100644 hphp/test/slow/array_escalation/387.php delete mode 100644 hphp/test/slow/array_escalation/387.php.expect delete mode 100644 hphp/test/slow/array_escalation/388.php delete mode 100644 hphp/test/slow/array_escalation/388.php.expect delete mode 100644 hphp/test/slow/array_escalation/389.php delete mode 100644 hphp/test/slow/array_escalation/389.php.expect delete mode 100644 hphp/test/slow/array_escalation/390.php delete mode 100644 hphp/test/slow/array_escalation/390.php.expect delete mode 100644 hphp/test/slow/array_escalation/391.php delete mode 100644 hphp/test/slow/array_escalation/391.php.expect delete mode 100644 hphp/test/slow/array_escalation/392.php delete mode 100644 hphp/test/slow/array_escalation/392.php.expect delete mode 100644 hphp/test/slow/array_escalation/393.php delete mode 100644 hphp/test/slow/array_escalation/393.php.expect delete mode 100644 hphp/test/slow/array_escalation/394.php delete mode 100644 hphp/test/slow/array_escalation/394.php.expect delete mode 100644 hphp/test/slow/array_escalation/395.php delete mode 100644 hphp/test/slow/array_escalation/395.php.expect delete mode 100644 hphp/test/slow/array_escalation/396.php delete mode 100644 hphp/test/slow/array_escalation/396.php.expect delete mode 100644 hphp/test/slow/array_escalation/397.php delete mode 100644 hphp/test/slow/array_escalation/397.php.expect delete mode 100644 hphp/test/slow/array_escalation/398.php delete mode 100644 hphp/test/slow/array_escalation/398.php.expect delete mode 100644 hphp/test/slow/array_escalation/399.php delete mode 100644 hphp/test/slow/array_escalation/399.php.expect delete mode 100644 hphp/test/slow/array_escalation/400.php delete mode 100644 hphp/test/slow/array_escalation/400.php.expect delete mode 100644 hphp/test/slow/array_escalation/401.php delete mode 100644 hphp/test/slow/array_escalation/401.php.expect delete mode 100644 hphp/test/slow/array_escalation/402.php delete mode 100644 hphp/test/slow/array_escalation/402.php.expect delete mode 100644 hphp/test/slow/array_escalation/403.php delete mode 100644 hphp/test/slow/array_escalation/403.php.expect delete mode 100644 hphp/test/slow/array_escalation/404.php delete mode 100644 hphp/test/slow/array_escalation/404.php.expect delete mode 100644 hphp/test/slow/array_escalation/405.php delete mode 100644 hphp/test/slow/array_escalation/405.php.expect delete mode 100644 hphp/test/slow/array_escalation/406.php delete mode 100644 hphp/test/slow/array_escalation/406.php.expect delete mode 100644 hphp/test/slow/array_escalation/407.php delete mode 100644 hphp/test/slow/array_escalation/407.php.expect delete mode 100644 hphp/test/slow/array_escalation/408.php delete mode 100644 hphp/test/slow/array_escalation/408.php.expect delete mode 100644 hphp/test/slow/array_escalation/409.php delete mode 100644 hphp/test/slow/array_escalation/409.php.expect delete mode 100644 hphp/test/slow/array_escalation/410.php delete mode 100644 hphp/test/slow/array_escalation/410.php.expect delete mode 100644 hphp/test/slow/array_escalation/411.php delete mode 100644 hphp/test/slow/array_escalation/411.php.expect delete mode 100644 hphp/test/slow/array_escalation/412.php delete mode 100644 hphp/test/slow/array_escalation/412.php.expect delete mode 100644 hphp/test/slow/array_escalation/413.php delete mode 100644 hphp/test/slow/array_escalation/413.php.expect delete mode 100644 hphp/test/slow/array_escalation/414.php delete mode 100644 hphp/test/slow/array_escalation/414.php.expect delete mode 100644 hphp/test/slow/array_escalation/415.php delete mode 100644 hphp/test/slow/array_escalation/415.php.expect delete mode 100644 hphp/test/slow/array_escalation/416.php delete mode 100644 hphp/test/slow/array_escalation/416.php.expect delete mode 100644 hphp/test/slow/compilation/1297.php delete mode 100644 hphp/test/slow/compilation/1297.php.expect rewrite hphp/test/slow/hack_arr_compat/add.php.expectf (100%) delete mode 100644 hphp/test/slow/hack_array_pluseq.php delete mode 100644 hphp/test/slow/hack_array_pluseq.php.expect delete mode 100644 hphp/test/slow/spec/tests/expressions/additive_operators/array_concatenation.php delete mode 100644 hphp/test/slow/spec/tests/expressions/additive_operators/array_concatenation.php.expectf delete mode 100644 hphp/test/zend/good/Zend/tests/add_001.php delete mode 100644 hphp/test/zend/good/Zend/tests/add_001.php.expectf diff --git a/hphp/doc/ir.specification b/hphp/doc/ir.specification index 57fcc950633..fb9e874a75b 100644 --- a/hphp/doc/ir.specification +++ b/hphp/doc/ir.specification @@ -2295,10 +2295,6 @@ To string conversions: in the IR because many eval stack slots are not entirely typed wrt initness right now.) -| ArrayAdd, D(Arr), S(Arr) S(Arr), CRc|PRc - - Has the effects of the php + operator on the two source arrays. - | AKExistsArr, D(Bool), S(Arr) S(Int,Str), NF Has the effects of array_key_exists(S0, S1). diff --git a/hphp/runtime/base/array-data-defs.h b/hphp/runtime/base/array-data-defs.h index 302fad43b41..624e14f4929 100644 --- a/hphp/runtime/base/array-data-defs.h +++ b/hphp/runtime/base/array-data-defs.h @@ -235,10 +235,6 @@ inline bool ArrayData::uasort(const Variant& compare) { return g_array_funcs.uasort[kind()](this, compare); } -inline ArrayData* ArrayData::plusEq(const ArrayData* elms) { - return g_array_funcs.plusEq[kind()](this, elms); -} - inline ArrayData* ArrayData::merge(const ArrayData* elms) { auto ret = g_array_funcs.merge[kind()](this, elms); assertx(ret->isHAMSafeDArray()); diff --git a/hphp/runtime/base/array-data.cpp b/hphp/runtime/base/array-data.cpp index 04b79818fc9..a646957e37e 100644 --- a/hphp/runtime/base/array-data.cpp +++ b/hphp/runtime/base/array-data.cpp @@ -566,15 +566,6 @@ const ArrayFunctions g_array_funcs = { DISPATCH(Append) /* - * ArrayData* PlusEq(ArrayData*, const ArrayData* elems) - * - * Performs array addition, logically mutating the first array. - * It may return a new array if the array needed to grow, or if - * it needed to COW because cowCheck() was true. - */ - DISPATCH(PlusEq) - - /* * ArrayData* Merge(ArrayData*, const ArrayData* elems) * * Perform part of the semantics of the php function array_merge. @@ -1135,8 +1126,8 @@ void throwInvalidKeysetOperation() { } void throwInvalidAdditionException(const ArrayData* ad) { - assertx(ad->isHackArrayType()); const char* type = [&]{ + if (ad->isPHPArrayType()) return "Arrays"; if (ad->isVecType()) return "Vecs"; if (ad->isDictType()) return "Dicts"; if (ad->isKeysetType()) return "Keysets"; @@ -1157,10 +1148,6 @@ void throwVecUnsetException() { /////////////////////////////////////////////////////////////////////////////// -void raiseHackArrCompatAdd() { - raise_hac_array_plus_notice("Using + operator on arrays"); -} - void raiseHackArrCompatArrHackArrCmp() { raise_hac_compare_notice(Strings::HACKARR_COMPAT_ARR_HACK_ARR_CMP); } diff --git a/hphp/runtime/base/array-data.h b/hphp/runtime/base/array-data.h index cef6f850772..bf2c8dc7f12 100644 --- a/hphp/runtime/base/array-data.h +++ b/hphp/runtime/base/array-data.h @@ -549,9 +549,8 @@ public: bool uasort(const Variant& cmp_function); /* - * PHP += and array_merge() implementations. + * PHP array_merge() implementations. */ - ArrayData* plusEq(const ArrayData* elems); ArrayData* merge(const ArrayData* elems); /* @@ -849,7 +848,6 @@ struct ArrayFunctions { ArrayData* (*copy[NK])(const ArrayData*); ArrayData* (*copyStatic[NK])(const ArrayData*); ArrayData* (*append[NK])(ArrayData*, TypedValue v); - ArrayData* (*plusEq[NK])(ArrayData*, const ArrayData* elems); ArrayData* (*merge[NK])(ArrayData*, const ArrayData* elems); ArrayData* (*pop[NK])(ArrayData*, Variant& value); ArrayData* (*dequeue[NK])(ArrayData*, Variant& value); @@ -888,8 +886,6 @@ extern const ArrayFunctions g_array_funcs; [[noreturn]] void throwVarrayUnsetException(); [[noreturn]] void throwVecUnsetException(); -void raiseHackArrCompatAdd(); - void raiseHackArrCompatArrHackArrCmp(); void raiseHackArrCompatDVArrCmp(const ArrayData*, const ArrayData*, bool); @@ -898,7 +894,6 @@ std::string makeHackArrCompatImplicitArrayKeyMsg(const TypedValue* key); StringData* getHackArrCompatNullHackArrayKeyMsg(); bool checkHACCompare(); -bool checkHACArrayPlus(); /* * Add a provenance tag for the current vmpc to `ad`, copying instead from diff --git a/hphp/runtime/base/bespoke-array.cpp b/hphp/runtime/base/bespoke-array.cpp index ee99081e608..87381192ff9 100644 --- a/hphp/runtime/base/bespoke-array.cpp +++ b/hphp/runtime/base/bespoke-array.cpp @@ -205,11 +205,8 @@ ArrayData* BespokeArray::Append(ArrayData* ad, TypedValue v) { ArrayData* BespokeArray::Prepend(ArrayData* ad, TypedValue v) { return asBespoke(ad)->layout()->prepend(ad, v); } -ArrayData* BespokeArray::PlusEq(ArrayData* ad, const ArrayData* other) { - return asBespoke(ad)->layout()->plusEq(ad, other); -} ArrayData* BespokeArray::Merge(ArrayData* ad, const ArrayData* elems) { - return asBespoke(ad)->layout()->plusEq(ad, elems); + return asBespoke(ad)->layout()->merge(ad, elems); } ArrayData* BespokeArray::Pop(ArrayData* ad, Variant& out) { return asBespoke(ad)->layout()->pop(ad, out); diff --git a/hphp/runtime/base/bespoke-array.h b/hphp/runtime/base/bespoke-array.h index 1126e202599..ab45cbea8ee 100644 --- a/hphp/runtime/base/bespoke-array.h +++ b/hphp/runtime/base/bespoke-array.h @@ -114,7 +114,6 @@ public: // high-level ops static ArrayData* Append(ArrayData* ad, TypedValue v); static ArrayData* Prepend(ArrayData* ad, TypedValue v); - static ArrayData* PlusEq(ArrayData* ad, const ArrayData* other); static ArrayData* Merge(ArrayData* ad, const ArrayData* elems); static ArrayData* Pop(ArrayData* ad, Variant& out); static ArrayData* Dequeue(ArrayData* ad, Variant& out); diff --git a/hphp/runtime/base/bespoke/layout.h b/hphp/runtime/base/bespoke/layout.h index 15a9d64c50a..e6296104ab2 100644 --- a/hphp/runtime/base/bespoke/layout.h +++ b/hphp/runtime/base/bespoke/layout.h @@ -67,7 +67,6 @@ struct Layout { virtual ArrayData* append(ArrayData*, TypedValue v) const = 0; virtual ArrayData* prepend(ArrayData*, TypedValue v) const = 0; - virtual ArrayData* plusEq(ArrayData*, const ArrayData*) const = 0; virtual ArrayData* merge(ArrayData*, const ArrayData*) const = 0; virtual ArrayData* pop(ArrayData*, Variant&) const = 0; virtual ArrayData* dequeue(ArrayData*, Variant&) const = 0; diff --git a/hphp/runtime/base/bespoke/logging-array.cpp b/hphp/runtime/base/bespoke/logging-array.cpp index 0c313100981..cce10b10f1c 100644 --- a/hphp/runtime/base/bespoke/logging-array.cpp +++ b/hphp/runtime/base/bespoke/logging-array.cpp @@ -282,9 +282,6 @@ ArrayData* LoggingLayout::append(ArrayData* ad, TypedValue v) const { ArrayData* LoggingLayout::prepend(ArrayData* ad, TypedValue v) const { return mutate(ad, [&](ArrayData* w) { return w->prepend(v); }); } -ArrayData* LoggingLayout::plusEq(ArrayData* ad, const ArrayData* arr) const { - return mutate(ad, [&](ArrayData* w) { return w->plusEq(arr); }); -} ArrayData* LoggingLayout::merge(ArrayData* ad, const ArrayData* arr) const { return mutate(ad, [&](ArrayData* w) { return w->merge(arr); }); } diff --git a/hphp/runtime/base/bespoke/logging-array.h b/hphp/runtime/base/bespoke/logging-array.h index 3329624fa0f..bf87ab4bcee 100644 --- a/hphp/runtime/base/bespoke/logging-array.h +++ b/hphp/runtime/base/bespoke/logging-array.h @@ -80,7 +80,6 @@ struct LoggingLayout : public Layout { ArrayData* append(ArrayData*, TypedValue v) const final; ArrayData* prepend(ArrayData*, TypedValue v) const final; - ArrayData* plusEq(ArrayData*, const ArrayData*) const final; ArrayData* merge(ArrayData*, const ArrayData*) const final; ArrayData* pop(ArrayData*, Variant&) const final; ArrayData* dequeue(ArrayData*, Variant&) const final; diff --git a/hphp/runtime/base/mixed-array.cpp b/hphp/runtime/base/mixed-array.cpp index a5c026dec29..bceb2367049 100644 --- a/hphp/runtime/base/mixed-array.cpp +++ b/hphp/runtime/base/mixed-array.cpp @@ -1333,87 +1333,6 @@ MixedArray* MixedArray::CopyReserve(const MixedArray* src, } NEVER_INLINE -ArrayData* MixedArray::ArrayPlusEqGeneric(ArrayData* ad, - MixedArray* ret, - const ArrayData* elems, - size_t neededSize) { - assertx(ad->isPHPArrayType()); - assertx(elems->isPHPArrayType()); - assertx(ret->hasVanillaMixedLayout()); - - for (ArrayIter it(elems); !it.end(); it.next()) { - Variant key = it.first(); - auto const value = it.secondVal(); - - if (UNLIKELY(ret->isFull())) { - assertx(ret == ad); - ret = CopyReserve(asMixed(ad), neededSize); - } - - auto tv = key.asTypedValue(); - auto p = tv->m_type == KindOfInt64 - ? ret->insert(tv->m_data.num) - : ret->insert(tv->m_data.pstr); - if (!p.found) { - tvDup(value, p.tv); - } - } - - return ret; -} - -// Note: the logic relating to how to grow in this function is coupled -// to PackedArray::PlusEq. -ArrayData* MixedArray::PlusEq(ArrayData* ad, const ArrayData* elems) { - assertx(asMixed(ad)->checkInvariants()); - - if (!ad->isPHPArrayType()) throwInvalidAdditionException(ad); - if (!elems->isPHPArrayType()) throwInvalidAdditionException(elems); - - auto const neededSize = ad->size() + elems->size(); - - auto ret = - ad->cowCheck() ? CopyReserve(asMixed(ad), neededSize) : - asMixed(ad); - - if (UNLIKELY(!elems->hasVanillaMixedLayout())) { - return ArrayPlusEqGeneric(ad, ret, elems, neededSize); - } - - auto const rhs = asMixed(elems); - - auto srcElem = rhs->data(); - auto const srcStop = rhs->data() + rhs->m_used; - for (; srcElem != srcStop; ++srcElem) { - if (srcElem->isTombstone()) continue; - - if (UNLIKELY(ret->isFull())) { - assertx(ret == ad); - ret = CopyReserve(ret, neededSize); - } - - auto const hash = srcElem->hash(); - if (srcElem->hasStrKey()) { - auto const ei = ret->findForInsertUpdate(srcElem->skey, hash); - if (isValidPos(ei)) continue; - auto e = ret->allocElm(ei); - e->setStrKey(srcElem->skey, hash); - ret->mutableKeyTypes()->recordStr(srcElem->skey); - tvDup(srcElem->data, e->data); - } else { - auto const ei = ret->findForInsertUpdate(srcElem->ikey, hash); - if (isValidPos(ei)) continue; - auto e = ret->allocElm(ei); - e->setIntKey(srcElem->ikey, hash); - ret->mutableKeyTypes()->recordInt(); - tvDup(srcElem->data, e->data); - } - } - - return ret; -} - -NEVER_INLINE ArrayData* MixedArray::ArrayMergeGeneric(MixedArray* ret, const ArrayData* elems) { assertx(ret->isHAMSafeDArray()); diff --git a/hphp/runtime/base/mixed-array.h b/hphp/runtime/base/mixed-array.h index 497735d27a6..ae6dddd7742 100644 --- a/hphp/runtime/base/mixed-array.h +++ b/hphp/runtime/base/mixed-array.h @@ -333,7 +333,6 @@ public: static ArrayData* Copy(const ArrayData*); static ArrayData* CopyStatic(const ArrayData*); static ArrayData* Append(ArrayData*, TypedValue v); - static ArrayData* PlusEq(ArrayData*, const ArrayData* elems); static ArrayData* Merge(ArrayData*, const ArrayData* elems); static ArrayData* Pop(ArrayData*, Variant& value); static ArrayData* Dequeue(ArrayData*, Variant& value); @@ -394,7 +393,6 @@ public: static constexpr auto CopyDict = &Copy; static constexpr auto CopyStaticDict = &CopyStatic; static constexpr auto AppendDict = &Append; - static constexpr auto PlusEqDict = &PlusEq; static constexpr auto MergeDict = &Merge; static constexpr auto PopDict = &Pop; static constexpr auto DequeueDict = &Dequeue; @@ -561,8 +559,6 @@ private: SortFlavor preSort(const AccessorT& acc, bool checkTypes); void postSort(bool resetKeys); - static ArrayData* ArrayPlusEqGeneric(ArrayData*, MixedArray*, - const ArrayData*, size_t); static ArrayData* ArrayMergeGeneric(MixedArray*, const ArrayData*); // Assert a bunch of invariants about this array then return true. diff --git a/hphp/runtime/base/packed-array.cpp b/hphp/runtime/base/packed-array.cpp index cd80c4ab826..9d19a1cecb1 100644 --- a/hphp/runtime/base/packed-array.cpp +++ b/hphp/runtime/base/packed-array.cpp @@ -743,29 +743,6 @@ ArrayData* PackedArray::AppendInPlace(ArrayData* adIn, TypedValue v) { return AppendImpl(adIn, v, false); } -ArrayData* PackedArray::PlusEq(ArrayData* adIn, const ArrayData* elems) { - assertx(checkInvariants(adIn)); - assertx(adIn->isPackedKind()); - if (!elems->isPHPArrayType()) throwInvalidAdditionException(elems); - auto const neededSize = adIn->size() + elems->size(); - auto const mixed = ToMixedCopyReserve(adIn, neededSize); - try { - auto const ret = MixedArray::PlusEq(mixed, elems); - assertx(ret == mixed); - assertx(mixed->hasExactlyOneRef()); - return ret; - } catch (...) { - MixedArray::Release(mixed); - throw; - } -} - -ArrayData* PackedArray::PlusEqVec(ArrayData* adIn, const ArrayData* /*elems*/) { - assertx(checkInvariants(adIn)); - assertx(adIn->isVecKind()); - throwInvalidAdditionException(adIn); -} - ArrayData* PackedArray::Merge(ArrayData* adIn, const ArrayData* elems) { assertx(checkInvariants(adIn)); auto const neededSize = adIn->m_size + elems->size(); diff --git a/hphp/runtime/base/packed-array.h b/hphp/runtime/base/packed-array.h index cb078159263..d8eeb7c660e 100644 --- a/hphp/runtime/base/packed-array.h +++ b/hphp/runtime/base/packed-array.h @@ -98,7 +98,6 @@ struct PackedArray final : type_scan::MarkCollectable { static bool Usort(ArrayData*, const Variant&); static bool Uasort(ArrayData*, const Variant&); static ArrayData* Append(ArrayData*, TypedValue v); - static ArrayData* PlusEq(ArrayData*, const ArrayData* elems); static ArrayData* Merge(ArrayData*, const ArrayData* elems); static ArrayData* Pop(ArrayData*, Variant& value); static ArrayData* Dequeue(ArrayData*, Variant& value); @@ -115,7 +114,6 @@ struct PackedArray final : type_scan::MarkCollectable { static arr_lval LvalIntVec(ArrayData*, int64_t); static arr_lval LvalStrVec(ArrayData*, StringData*); - static ArrayData* PlusEqVec(ArrayData*, const ArrayData*); static constexpr auto ToPHPArrayVec = &ToPHPArray; static ArrayData* ToVArrayVec(ArrayData*, bool); static constexpr auto ToDictVec = &ToDict; diff --git a/hphp/runtime/base/set-array.cpp b/hphp/runtime/base/set-array.cpp index d9ad38a40f8..3f5cd654efc 100644 --- a/hphp/runtime/base/set-array.cpp +++ b/hphp/runtime/base/set-array.cpp @@ -664,11 +664,6 @@ ArrayData* SetArray::Append(ArrayData* ad, TypedValue v) { return AppendImpl(ad, v, ad->cowCheck()); } -ArrayData* SetArray::PlusEq(ArrayData* ad, const ArrayData*) { - assertx(asSet(ad)->checkInvariants()); - throwInvalidAdditionException(ad); -} - ArrayData* SetArray::Merge(ArrayData*, const ArrayData*) { SystemLib::throwInvalidOperationExceptionObject( "Invalid keyset operation (merge)" diff --git a/hphp/runtime/base/set-array.h b/hphp/runtime/base/set-array.h index 79bd9a3b3e6..53aac142139 100644 --- a/hphp/runtime/base/set-array.h +++ b/hphp/runtime/base/set-array.h @@ -405,7 +405,6 @@ public: static ArrayData* Copy(const ArrayData*); static ArrayData* CopyStatic(const ArrayData*); static ArrayData* Append(ArrayData*, TypedValue); - static ArrayData* PlusEq(ArrayData*, const ArrayData*); static ArrayData* Merge(ArrayData*, const ArrayData*); static ArrayData* Pop(ArrayData*, Variant&); static ArrayData* Dequeue(ArrayData*, Variant&); diff --git a/hphp/runtime/base/tv-arith.cpp b/hphp/runtime/base/tv-arith.cpp index b125486cca5..eaf519313db 100644 --- a/hphp/runtime/base/tv-arith.cpp +++ b/hphp/runtime/base/tv-arith.cpp @@ -216,12 +216,7 @@ struct Add { } ArrayData* operator()(ArrayData* a1, ArrayData* a2) const { - if (UNLIKELY(a1->isHackArrayType())) throwInvalidAdditionException(a1); - if (UNLIKELY(a2->isHackArrayType())) throwInvalidAdditionException(a2); - if (checkHACArrayPlus()) raiseHackArrCompatAdd(); - a1->incRefCount(); // force COW - SCOPE_EXIT { a1->decRefCount(); }; - return a1->plusEq(a2); + throwInvalidAdditionException(a1); } }; @@ -350,15 +345,7 @@ struct AddEq { double operator()(double a, double b) const { return a + b; } ArrayData* operator()(ArrayData* ad1, ArrayData* ad2) const { - if (UNLIKELY(ad1->isHackArrayType())) throwInvalidAdditionException(ad1); - if (UNLIKELY(ad2->isHackArrayType())) throwInvalidAdditionException(ad2); - if (checkHACArrayPlus()) raiseHackArrCompatAdd(); - if (ad2->empty() || ad1 == ad2) return ad1; - if (ad1->empty()) { - ad2->incRefCount(); - return ad2; - } - return ad1->plusEq(ad2); + throwInvalidAdditionException(ad1); } }; diff --git a/hphp/runtime/base/type-array.cpp b/hphp/runtime/base/type-array.cpp index bc39931d91d..d533367b13e 100644 --- a/hphp/runtime/base/type-array.cpp +++ b/hphp/runtime/base/type-array.cpp @@ -90,35 +90,12 @@ ArrayIter Array::begin(const String& /*context*/ /* = null_string */) const { /////////////////////////////////////////////////////////////////////////////// // PHP operations. -Array Array::operator+(ArrayData *data) const { - return Array(*this).plusImpl(data); -} - -Array Array::operator+(const Array& arr) const { - return Array(*this).plusImpl(arr.get()); -} - -Array& Array::operator+=(ArrayData *data) { - return plusImpl(data); -} - NEVER_INLINE static void throw_bad_array_merge() { throw ExtendedException("Invalid operand type was used: " "merging an array with NULL or non-array."); } -Array& Array::operator+=(const Variant& var) { - if (!var.isArray()) { - throw_bad_array_merge(); - } - return operator+=(var.getArrayData()); -} - -Array& Array::operator+=(const Array& arr) { - return plusImpl(arr.get()); -} - Array Array::diff(const Variant& array, bool by_key, bool by_value, PFUNC_CMP key_cmp_function /* = NULL */, const void *key_data /* = NULL */, @@ -292,24 +269,6 @@ Array& Array::merge(const Array& arr) { return mergeImpl(arr.get()); } -Array& Array::plusImpl(ArrayData *data) { - if (m_arr == nullptr || data == nullptr) { - throw_bad_array_merge(); - } - if (checkHACArrayPlus()) raiseHackArrCompatAdd(); - if (!data->empty()) { - if (m_arr->empty()) { - m_arr = data; - } else if (m_arr != data) { - auto const escalated = m_arr->plusEq(data); - if (escalated != m_arr) { - m_arr = Ptr::attach(escalated); - } - } - } - return *this; -} - Array& Array::mergeImpl(ArrayData *data) { if (m_arr == nullptr || data == nullptr) { throw_bad_array_merge(); diff --git a/hphp/runtime/base/type-array.h b/hphp/runtime/base/type-array.h index 1d2a1045181..80adaf62936 100644 --- a/hphp/runtime/base/type-array.h +++ b/hphp/runtime/base/type-array.h @@ -260,12 +260,12 @@ public: /* * PHP array union operator. */ - Array operator+(ArrayData* data) const; - Array operator+(const Array& v) const; + Array operator+(ArrayData* data) const = delete; + Array operator+(const Array& v) const = delete; Array operator+(const Variant& v) const = delete; - Array& operator+=(ArrayData* data); - Array& operator+=(const Array& v); - Array& operator+=(const Variant& v); + Array& operator+=(ArrayData* data) = delete; + Array& operator+=(const Array& v) = delete; + Array& operator+=(const Variant& v) = delete; /* * Implementation of array_merge(). @@ -509,7 +509,6 @@ public: private: Array(ArrayData* ad, NoIncRef) : m_arr(ad, NoIncRef{}) {} - Array& plusImpl(ArrayData* data); Array& mergeImpl(ArrayData* data); Array diffImpl(const Array& array, bool by_key, bool by_value, bool match, PFUNC_CMP key_cmp_function, const void* key_data, diff --git a/hphp/runtime/debugger/cmd/cmd_info.cpp b/hphp/runtime/debugger/cmd/cmd_info.cpp index a6eef6a85e9..945260fe047 100644 --- a/hphp/runtime/debugger/cmd/cmd_info.cpp +++ b/hphp/runtime/debugger/cmd/cmd_info.cpp @@ -328,8 +328,12 @@ bool CmdInfo::onServer(DebuggerProxy &proxy) { Logger::Error("Caught unknown exception, auto-complete lists incomplete"); } - Array variables = g_context->getLocalDefinedVariablesDebugger(0); - variables += CmdVariable::GetGlobalVariables(); + // Local variables shadow global variables with the same name. + Array variables = CmdVariable::GetGlobalVariables(); + auto const locals = g_context->getLocalDefinedVariablesDebugger(0); + IterateKV(locals.get(), [&](TypedValue key, TypedValue val) { + variables.set(key, val); + }); auto& vars = m_acLiveLists->get(DebuggerClient::AutoCompleteVariables); vars.reserve(variables.size()); for (ArrayIter iter(variables); iter; ++iter) { diff --git a/hphp/runtime/ext/soap/ext_soap.cpp b/hphp/runtime/ext/soap/ext_soap.cpp index d68ed461d86..b4e2ef0c6c0 100644 --- a/hphp/runtime/ext/soap/ext_soap.cpp +++ b/hphp/runtime/ext/soap/ext_soap.cpp @@ -2100,7 +2100,12 @@ Variant HHVM_METHOD(SoapServer, getfunctions) { } else if (data->m_type == SOAP_CLASS) { class_name = data->m_soap_class.name; } else if (data->m_soap_functions.functions_all) { - return (Unit::getSystemFunctions() + Unit::getUserFunctions()).toVArray(); + auto funcs1 = Unit::getSystemFunctions(); + auto funcs2 = Unit::getUserFunctions(); + VArrayInit init(funcs1.size() + funcs2.size()); + IterateV(funcs1.get(), [&](TypedValue tv) { init.append(tv); }); + IterateV(funcs2.get(), [&](TypedValue tv) { init.append(tv); }); + return init.toArray(); } else if (!data->m_soap_functions.ft.empty()) { return Variant::attach( HHVM_FN(array_keys)( diff --git a/hphp/runtime/test/array.cpp b/hphp/runtime/test/array.cpp index 2232d6f86d0..33dba9b2996 100644 --- a/hphp/runtime/test/array.cpp +++ b/hphp/runtime/test/array.cpp @@ -501,12 +501,7 @@ TEST(ARRAY, Membership) { TEST(ARRAY, Merge) { { - Array arr = make_varray(0) + make_varray(1); - EXPECT_TRUE(same_arrays(arr, make_varray(0).toDArray())); - arr += make_varray(0, 1); - EXPECT_TRUE(same_arrays(arr, make_varray(0, 1).toDArray())); - - arr = make_varray(0).merge(make_varray(1)); + Array arr = make_varray(0).merge(make_varray(1)); EXPECT_TRUE(same_arrays(arr, make_varray(0, 1).toDArray())); arr = arr.merge(make_varray(0, 1)); EXPECT_TRUE(same_arrays(arr, make_varray(0, 1, 0, 1).toDArray())); @@ -514,11 +509,6 @@ TEST(ARRAY, Merge) { arr = make_varray("s0").merge(make_varray("s1")); EXPECT_TRUE(same_arrays(arr, make_varray("s0", "s1").toDArray())); - arr = make_map_array("n0", "s0") + make_map_array("n1", "s1"); - EXPECT_TRUE(same_arrays(arr, make_map_array("n0", "s0", "n1", "s1"))); - arr += make_map_array("n0", "s0", "n1", "s1"); - EXPECT_TRUE(same_arrays(arr, make_map_array("n0", "s0", "n1", "s1"))); - arr = make_map_array("n0", "s0").merge(make_map_array("n1", "s1")); EXPECT_TRUE(same_arrays(arr, make_darray("n0", "s0", "n1", "s1"))); Array arrX = make_map_array("n0", "s2", "n1", "s3"); diff --git a/hphp/runtime/vm/jit/dce.cpp b/hphp/runtime/vm/jit/dce.cpp index d0057ad46b5..fdffcc7fa53 100644 --- a/hphp/runtime/vm/jit/dce.cpp +++ b/hphp/runtime/vm/jit/dce.cpp @@ -561,7 +561,6 @@ bool canDCE(IRInstruction* inst) { case PrintStr: case PrintInt: case PrintBool: - case ArrayAdd: case GetMemoKey: case LdSwitchObjIndex: case LdSSwitchDestSlow: diff --git a/hphp/runtime/vm/jit/ir-opcode.cpp b/hphp/runtime/vm/jit/ir-opcode.cpp index 9293dadd65a..78b6b297cfe 100644 --- a/hphp/runtime/vm/jit/ir-opcode.cpp +++ b/hphp/runtime/vm/jit/ir-opcode.cpp @@ -299,7 +299,6 @@ bool opcodeMayRaise(Opcode opc) { case AKExistsObj: case AllocObj: case AllocObjReified: - case ArrayAdd: case ArrayGet: case ArraySet: case BaseG: diff --git a/hphp/runtime/vm/jit/irgen-arith.cpp b/hphp/runtime/vm/jit/irgen-arith.cpp index c95921a90fb..42f8c6ed55a 100644 --- a/hphp/runtime/vm/jit/irgen-arith.cpp +++ b/hphp/runtime/vm/jit/irgen-arith.cpp @@ -1553,14 +1553,6 @@ void implCmp(IRGS& env, Op op) { } void implAdd(IRGS& env, Op op) { - if (topC(env, BCSPRelOffset{0})->type() <= TArr && - topC(env, BCSPRelOffset{1})->type() <= TArr) { - auto const tr = popC(env); - auto const tl = popC(env); - // The ArrayAdd helper decrefs its args, so don't decref pop'ed values. - push(env, gen(env, ArrayAdd, tl, tr)); - return; - } binaryArith(env, op); } @@ -1680,27 +1672,6 @@ void emitSetOpL(IRGS& env, int32_t id, SetOpOp subop) { // Null guard block for globals because we always punt on pseudomains auto const ldPMExit = nullptr; - - /* - * Handle array addition first because we don't want to bother with - * boxed locals. - */ - bool const isAdd = (*subOpc == Op::Add || *subOpc == Op::AddO); - if (isAdd && (env.irb->local(id, DataTypeSpecific).type <= TArr) && - topC(env)->isA(TArr)) { - /* - * ArrayAdd decrefs its sources and returns a new array with - * refcount == 1. That covers the local, so incref once more for - * the stack. - */ - auto const loc = ldLoc(env, id, ldPMExit, DataTypeSpecific); - auto const val = popC(env); - auto const result = gen(env, ArrayAdd, loc, val); - stLocRaw(env, id, fp(env), result); - pushIncRef(env, result); - return; - } - auto loc = ldLoc(env, id, ldPMExit, DataTypeGeneric); if (*subOpc == Op::Concat) { diff --git a/hphp/runtime/vm/jit/irlower-array.cpp b/hphp/runtime/vm/jit/irlower-array.cpp index 622bbbaaaf1..de0fa42b2b2 100644 --- a/hphp/runtime/vm/jit/irlower-array.cpp +++ b/hphp/runtime/vm/jit/irlower-array.cpp @@ -87,8 +87,6 @@ void cgCheckPackedArrayDataBounds(IRLS& env, const IRInstruction* inst) { v << jcc{CC_BE, sf, {label(env, inst->next()), label(env, inst->taken())}}; } -IMPL_OPCODE_CALL(ArrayAdd); - //////////////////////////////////////////////////////////////////////////////// namespace { diff --git a/hphp/runtime/vm/jit/memory-effects.cpp b/hphp/runtime/vm/jit/memory-effects.cpp index f52027336be..aba2ed0331b 100644 --- a/hphp/runtime/vm/jit/memory-effects.cpp +++ b/hphp/runtime/vm/jit/memory-effects.cpp @@ -1917,7 +1917,6 @@ MemEffects memory_effects_impl(const IRInstruction& inst) { case LookupFuncCached: // autoload case StringGet: // raise_notice case OrdStrIdx: // raise_notice - case ArrayAdd: // decrefs source case AddNewElem: // can re-enter case AddNewElemKeyset: // can re-enter case ArrayGet: // kVPackedKind warnings diff --git a/hphp/runtime/vm/jit/native-calls.cpp b/hphp/runtime/vm/jit/native-calls.cpp index 5775c0f75c7..318bfda92d0 100644 --- a/hphp/runtime/vm/jit/native-calls.cpp +++ b/hphp/runtime/vm/jit/native-calls.cpp @@ -65,7 +65,6 @@ namespace { constexpr irlower::SyncOptions SNone = irlower::SyncOptions::None; constexpr irlower::SyncOptions SSync = irlower::SyncOptions::Sync; -constexpr DestType DTV = DestType::TV; constexpr DestType DSSA = DestType::SSA; constexpr DestType DNone = DestType::None; @@ -120,7 +119,6 @@ static auto c_AsyncFunctionWaitHandle_Create_false = * function must be non-virtual. * * Dest - * DTV - The helper returns a two-register TypedValue * DSSA - The helper returns a single-register value * DNone - The helper does not return a value * @@ -220,7 +218,6 @@ static CallMap s_callMap { {{SSA, 0}, {SSA, 1}, {SSA, 2}, {SSA, 3}}}, {AddNewElem, addNewElemHelper, DSSA, SSync, {{SSA, 0}, {TV, 1}}}, - {ArrayAdd, arrayAdd, DTV, SSync, {{SSA, 0}, {SSA, 1}}}, {Clone, &ObjectData::clone, DSSA, SSync, {{SSA, 0}}}, {NewRFunc, RFuncData::newInstance, DSSA, SNone, {{SSA, 0}, {SSA, 1}}}, diff --git a/hphp/runtime/vm/jit/translator-runtime.cpp b/hphp/runtime/vm/jit/translator-runtime.cpp index dd57ef32803..2a9725f8086 100644 --- a/hphp/runtime/vm/jit/translator-runtime.cpp +++ b/hphp/runtime/vm/jit/translator-runtime.cpp @@ -88,32 +88,6 @@ ArrayData* addNewElemHelper(ArrayData* a, TypedValue value) { return r; } -TypedValue arrayAdd(ArrayData* a1, ArrayData* a2) { - assertx(a1->isPHPArrayType()); - assertx(a2->isPHPArrayType()); - - if (checkHACArrayPlus()) raiseHackArrCompatAdd(); - - if (!a2->empty()) { - if (a1->empty()) { - // We consume refs on a2 and also produce references, so there's - // no need to inc/dec a2. - decRefArr(a1); - return make_array_like_tv(a2); - } - if (a1 != a2) { - auto const escalated = a1->plusEq(a2); - if (escalated != a1) { - decRefArr(a2); - decRefArr(a1); - return make_array_like_tv(escalated); - } - } - } - decRefArr(a2); - return make_array_like_tv(a1); -} - ArrayData* convArrToVecHelper(ArrayData* adIn) { assertx(adIn->isPHPArrayType()); auto a = adIn->toVec(adIn->cowCheck()); diff --git a/hphp/runtime/vm/jit/translator-runtime.h b/hphp/runtime/vm/jit/translator-runtime.h index ce1e1a71a88..39772012928 100644 --- a/hphp/runtime/vm/jit/translator-runtime.h +++ b/hphp/runtime/vm/jit/translator-runtime.h @@ -51,7 +51,6 @@ ArrayData* addElemStringKeyHelper(ArrayData* ad, StringData* key, ArrayData* dictAddElemIntKeyHelper(ArrayData* ad, int64_t key, TypedValue val); ArrayData* dictAddElemStringKeyHelper(ArrayData* ad, StringData* key, TypedValue val); -TypedValue arrayAdd(ArrayData* a1, ArrayData* a2); /* Helper functions for conversion instructions that are too * complicated to inline */ diff --git a/hphp/test/quick/static-arr.php b/hphp/test/quick/static-arr.php index d20ada4bc79..a141045ba01 100644 --- a/hphp/test/quick/static-arr.php +++ b/hphp/test/quick/static-arr.php @@ -2,8 +2,7 @@ <<__EntryPoint>> function main(): void { - $x = varray[]; - $x += varray[1, 2, 3]; + $x = varray[1, 2, 3]; var_dump($x); $s = 'hi'; diff --git a/hphp/test/slow/array/220.php b/hphp/test/slow/array/220.php deleted file mode 100644 index 6cebc5dd506..00000000000 --- a/hphp/test/slow/array/220.php +++ /dev/null @@ -1,10 +0,0 @@ -> -function main_220() { -$a = varray[1]; - $b = varray[2]; - $c = $a + $b; - var_dump($c); -} diff --git a/hphp/test/slow/array/220.php.expect b/hphp/test/slow/array/220.php.expect deleted file mode 100644 index 4ef6cec395a..00000000000 --- a/hphp/test/slow/array/220.php.expect +++ /dev/null @@ -1,4 +0,0 @@ -array(1) { - [0]=> - int(1) -} diff --git a/hphp/test/slow/array/220.php.hphp_opts b/hphp/test/slow/array/220.php.hphp_opts deleted file mode 100644 index e2dbd226bf6..00000000000 --- a/hphp/test/slow/array/220.php.hphp_opts +++ /dev/null @@ -1 +0,0 @@ --d hhvm.php7.all=0 diff --git a/hphp/test/slow/array/220.php.opts b/hphp/test/slow/array/220.php.opts deleted file mode 120000 index 192ba8eb2b5..00000000000 --- a/hphp/test/slow/array/220.php.opts +++ /dev/null @@ -1 +0,0 @@ -../hiphop.opts \ No newline at end of file diff --git a/hphp/test/slow/array/221.php b/hphp/test/slow/array/221.php deleted file mode 100644 index 46380eba1c0..00000000000 --- a/hphp/test/slow/array/221.php +++ /dev/null @@ -1,10 +0,0 @@ -> -function main_221() { -$a = varray[1,2]; - $b = varray[2,3]; - $c = $a + $b; - var_dump($c); -} diff --git a/hphp/test/slow/array/221.php.expect b/hphp/test/slow/array/221.php.expect deleted file mode 100644 index a049ea68554..00000000000 --- a/hphp/test/slow/array/221.php.expect +++ /dev/null @@ -1,6 +0,0 @@ -array(2) { - [0]=> - int(1) - [1]=> - int(2) -} diff --git a/hphp/test/slow/array/221.php.hphp_opts b/hphp/test/slow/array/221.php.hphp_opts deleted file mode 100644 index e2dbd226bf6..00000000000 --- a/hphp/test/slow/array/221.php.hphp_opts +++ /dev/null @@ -1 +0,0 @@ --d hhvm.php7.all=0 diff --git a/hphp/test/slow/array/221.php.opts b/hphp/test/slow/array/221.php.opts deleted file mode 120000 index 192ba8eb2b5..00000000000 --- a/hphp/test/slow/array/221.php.opts +++ /dev/null @@ -1 +0,0 @@ -../hiphop.opts \ No newline at end of file diff --git a/hphp/test/slow/array/222.php b/hphp/test/slow/array/222.php deleted file mode 100644 index 0359743b553..00000000000 --- a/hphp/test/slow/array/222.php +++ /dev/null @@ -1,10 +0,0 @@ -> -function main_222() { -$a = varray[1,2]; - $b = varray[2]; - $c = $a + $b; - var_dump($c); -} diff --git a/hphp/test/slow/array/222.php.expect b/hphp/test/slow/array/222.php.expect deleted file mode 100644 index a049ea68554..00000000000 --- a/hphp/test/slow/array/222.php.expect +++ /dev/null @@ -1,6 +0,0 @@ -array(2) { - [0]=> - int(1) - [1]=> - int(2) -} diff --git a/hphp/test/slow/array/222.php.hphp_opts b/hphp/test/slow/array/222.php.hphp_opts deleted file mode 100644 index e2dbd226bf6..00000000000 --- a/hphp/test/slow/array/222.php.hphp_opts +++ /dev/null @@ -1 +0,0 @@ --d hhvm.php7.all=0 diff --git a/hphp/test/slow/array/222.php.opts b/hphp/test/slow/array/222.php.opts deleted file mode 120000 index 192ba8eb2b5..00000000000 --- a/hphp/test/slow/array/222.php.opts +++ /dev/null @@ -1 +0,0 @@ -../hiphop.opts \ No newline at end of file diff --git a/hphp/test/slow/array/223.php b/hphp/test/slow/array/223.php deleted file mode 100644 index 34567609091..00000000000 --- a/hphp/test/slow/array/223.php +++ /dev/null @@ -1,10 +0,0 @@ -> -function main_223() { -$a = varray[1]; - $b = varray[2,3]; - $c = $a + $b; - var_dump($c); -} diff --git a/hphp/test/slow/array/223.php.expect b/hphp/test/slow/array/223.php.expect deleted file mode 100644 index 46e8b5cc119..00000000000 --- a/hphp/test/slow/array/223.php.expect +++ /dev/null @@ -1,6 +0,0 @@ -array(2) { - [0]=> - int(1) - [1]=> - int(3) -} diff --git a/hphp/test/slow/array/223.php.hphp_opts b/hphp/test/slow/array/223.php.hphp_opts deleted file mode 100644 index e2dbd226bf6..00000000000 --- a/hphp/test/slow/array/223.php.hphp_opts +++ /dev/null @@ -1 +0,0 @@ --d hhvm.php7.all=0 diff --git a/hphp/test/slow/array/223.php.opts b/hphp/test/slow/array/223.php.opts deleted file mode 120000 index 192ba8eb2b5..00000000000 --- a/hphp/test/slow/array/223.php.opts +++ /dev/null @@ -1 +0,0 @@ -../hiphop.opts \ No newline at end of file diff --git a/hphp/test/slow/array/empty_array_009.php b/hphp/test/slow/array/empty_array_009.php deleted file mode 100644 index 92221ab1eb1..00000000000 --- a/hphp/test/slow/array/empty_array_009.php +++ /dev/null @@ -1,12 +0,0 @@ -> -function main_empty_array_009() { -var_dump(main()); -} diff --git a/hphp/test/slow/array/empty_array_009.php.expect b/hphp/test/slow/array/empty_array_009.php.expect deleted file mode 100644 index 468e3cd4225..00000000000 --- a/hphp/test/slow/array/empty_array_009.php.expect +++ /dev/null @@ -1,8 +0,0 @@ -array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) -} diff --git a/hphp/test/slow/array/internal-cursor-bug.php b/hphp/test/slow/array/internal-cursor-bug.php index 01eba6da2fc..66fda6aa78d 100644 --- a/hphp/test/slow/array/internal-cursor-bug.php +++ b/hphp/test/slow/array/internal-cursor-bug.php @@ -6,8 +6,6 @@ function f() { reset(inout $arr1); reset(inout $arr2); var_dump(current($arr1)); - $arr1 += $arr2; - var_dump(current($arr1)); } diff --git a/hphp/test/slow/array/internal-cursor-bug.php.expect b/hphp/test/slow/array/internal-cursor-bug.php.expect index 361acedea78..adedb5c318c 100644 --- a/hphp/test/slow/array/internal-cursor-bug.php.expect +++ b/hphp/test/slow/array/internal-cursor-bug.php.expect @@ -1,2 +1 @@ string(1) "b" -string(1) "b" diff --git a/hphp/test/slow/array_assignment/510.php b/hphp/test/slow/array_assignment/510.php deleted file mode 100644 index 05df3764b4a..00000000000 --- a/hphp/test/slow/array_assignment/510.php +++ /dev/null @@ -1,19 +0,0 @@ -$p, '2'=>$q]; - $b = darray['3'=>$r, '4'=>$s]; - var_dump($a); - $a += $b; - var_dump($a); - var_dump($b); -} - -<<__EntryPoint>> -function main_510() { -foo(); -} diff --git a/hphp/test/slow/array_assignment/510.php.expect b/hphp/test/slow/array_assignment/510.php.expect deleted file mode 100644 index c6084bb6fb1..00000000000 --- a/hphp/test/slow/array_assignment/510.php.expect +++ /dev/null @@ -1,22 +0,0 @@ -array(2) { - ["1"]=> - int(1) - ["2"]=> - int(2) -} -array(4) { - ["1"]=> - int(1) - ["2"]=> - int(2) - ["3"]=> - int(3) - ["4"]=> - int(4) -} -array(2) { - ["3"]=> - int(3) - ["4"]=> - int(4) -} diff --git a/hphp/test/slow/array_escalation/368.php b/hphp/test/slow/array_escalation/368.php deleted file mode 100644 index 615fa02b9e4..00000000000 --- a/hphp/test/slow/array_escalation/368.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_368() { -$a = varray[]; - $a += varray[]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/368.php.expect b/hphp/test/slow/array_escalation/368.php.expect deleted file mode 100644 index 63a30c0d89f..00000000000 --- a/hphp/test/slow/array_escalation/368.php.expect +++ /dev/null @@ -1,2 +0,0 @@ -array(0) { -} diff --git a/hphp/test/slow/array_escalation/369.php b/hphp/test/slow/array_escalation/369.php deleted file mode 100644 index feda3654566..00000000000 --- a/hphp/test/slow/array_escalation/369.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_369() { -$a = varray[]; - $a += varray[20]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/369.php.expect b/hphp/test/slow/array_escalation/369.php.expect deleted file mode 100644 index c0fea4217db..00000000000 --- a/hphp/test/slow/array_escalation/369.php.expect +++ /dev/null @@ -1,4 +0,0 @@ -array(1) { - [0]=> - int(20) -} diff --git a/hphp/test/slow/array_escalation/370.php b/hphp/test/slow/array_escalation/370.php deleted file mode 100644 index f25b18b6e94..00000000000 --- a/hphp/test/slow/array_escalation/370.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_370() { -$a = varray[]; - $a += varray['b']; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/370.php.expect b/hphp/test/slow/array_escalation/370.php.expect deleted file mode 100644 index 42504566577..00000000000 --- a/hphp/test/slow/array_escalation/370.php.expect +++ /dev/null @@ -1,4 +0,0 @@ -array(1) { - [0]=> - string(1) "b" -} diff --git a/hphp/test/slow/array_escalation/371.php b/hphp/test/slow/array_escalation/371.php deleted file mode 100644 index 053795bb9c7..00000000000 --- a/hphp/test/slow/array_escalation/371.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_371() { -$a = varray[]; - $a += varray[varray[3]]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/371.php.expect b/hphp/test/slow/array_escalation/371.php.expect deleted file mode 100644 index 973315d7805..00000000000 --- a/hphp/test/slow/array_escalation/371.php.expect +++ /dev/null @@ -1,7 +0,0 @@ -array(1) { - [0]=> - array(1) { - [0]=> - int(3) - } -} diff --git a/hphp/test/slow/array_escalation/372.php b/hphp/test/slow/array_escalation/372.php deleted file mode 100644 index 2ae9d01e703..00000000000 --- a/hphp/test/slow/array_escalation/372.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_372() { -$a = varray[]; - $a += darray['c' => 20]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/372.php.expect b/hphp/test/slow/array_escalation/372.php.expect deleted file mode 100644 index 88ff4b02421..00000000000 --- a/hphp/test/slow/array_escalation/372.php.expect +++ /dev/null @@ -1,4 +0,0 @@ -array(1) { - ["c"]=> - int(20) -} diff --git a/hphp/test/slow/array_escalation/373.php b/hphp/test/slow/array_escalation/373.php deleted file mode 100644 index baaa8f3c0b4..00000000000 --- a/hphp/test/slow/array_escalation/373.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_373() { -$a = varray[]; - $a += darray['c' => 'b']; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/373.php.expect b/hphp/test/slow/array_escalation/373.php.expect deleted file mode 100644 index 877dc24502a..00000000000 --- a/hphp/test/slow/array_escalation/373.php.expect +++ /dev/null @@ -1,4 +0,0 @@ -array(1) { - ["c"]=> - string(1) "b" -} diff --git a/hphp/test/slow/array_escalation/374.php b/hphp/test/slow/array_escalation/374.php deleted file mode 100644 index 227f12e424c..00000000000 --- a/hphp/test/slow/array_escalation/374.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_374() { -$a = varray[]; - $a += darray['c' => varray[3]]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/374.php.expect b/hphp/test/slow/array_escalation/374.php.expect deleted file mode 100644 index 64c10923b4c..00000000000 --- a/hphp/test/slow/array_escalation/374.php.expect +++ /dev/null @@ -1,7 +0,0 @@ -array(1) { - ["c"]=> - array(1) { - [0]=> - int(3) - } -} diff --git a/hphp/test/slow/array_escalation/375.php b/hphp/test/slow/array_escalation/375.php deleted file mode 100644 index 0fc11ebcba6..00000000000 --- a/hphp/test/slow/array_escalation/375.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_375() { -$a = varray[10]; - $a += varray[]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/375.php.expect b/hphp/test/slow/array_escalation/375.php.expect deleted file mode 100644 index 0d99c32dfea..00000000000 --- a/hphp/test/slow/array_escalation/375.php.expect +++ /dev/null @@ -1,4 +0,0 @@ -array(1) { - [0]=> - int(10) -} diff --git a/hphp/test/slow/array_escalation/376.php b/hphp/test/slow/array_escalation/376.php deleted file mode 100644 index 00b45c45b4a..00000000000 --- a/hphp/test/slow/array_escalation/376.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_376() { -$a = varray[10]; - $a += varray[20]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/376.php.expect b/hphp/test/slow/array_escalation/376.php.expect deleted file mode 100644 index 0d99c32dfea..00000000000 --- a/hphp/test/slow/array_escalation/376.php.expect +++ /dev/null @@ -1,4 +0,0 @@ -array(1) { - [0]=> - int(10) -} diff --git a/hphp/test/slow/array_escalation/377.php b/hphp/test/slow/array_escalation/377.php deleted file mode 100644 index 934046bf716..00000000000 --- a/hphp/test/slow/array_escalation/377.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_377() { -$a = varray[10]; - $a += varray['b']; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/377.php.expect b/hphp/test/slow/array_escalation/377.php.expect deleted file mode 100644 index 0d99c32dfea..00000000000 --- a/hphp/test/slow/array_escalation/377.php.expect +++ /dev/null @@ -1,4 +0,0 @@ -array(1) { - [0]=> - int(10) -} diff --git a/hphp/test/slow/array_escalation/378.php b/hphp/test/slow/array_escalation/378.php deleted file mode 100644 index bd154d03c05..00000000000 --- a/hphp/test/slow/array_escalation/378.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_378() { -$a = varray[10]; - $a += varray[varray[3]]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/378.php.expect b/hphp/test/slow/array_escalation/378.php.expect deleted file mode 100644 index 0d99c32dfea..00000000000 --- a/hphp/test/slow/array_escalation/378.php.expect +++ /dev/null @@ -1,4 +0,0 @@ -array(1) { - [0]=> - int(10) -} diff --git a/hphp/test/slow/array_escalation/379.php b/hphp/test/slow/array_escalation/379.php deleted file mode 100644 index 3383bbe7374..00000000000 --- a/hphp/test/slow/array_escalation/379.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_379() { -$a = varray[10]; - $a += darray['c' => 20]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/379.php.expect b/hphp/test/slow/array_escalation/379.php.expect deleted file mode 100644 index df69a81a9cf..00000000000 --- a/hphp/test/slow/array_escalation/379.php.expect +++ /dev/null @@ -1,6 +0,0 @@ -array(2) { - [0]=> - int(10) - ["c"]=> - int(20) -} diff --git a/hphp/test/slow/array_escalation/380.php b/hphp/test/slow/array_escalation/380.php deleted file mode 100644 index c2187fd2e27..00000000000 --- a/hphp/test/slow/array_escalation/380.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_380() { -$a = varray[10]; - $a += darray['c' => 'b']; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/380.php.expect b/hphp/test/slow/array_escalation/380.php.expect deleted file mode 100644 index 86ea0f00d30..00000000000 --- a/hphp/test/slow/array_escalation/380.php.expect +++ /dev/null @@ -1,6 +0,0 @@ -array(2) { - [0]=> - int(10) - ["c"]=> - string(1) "b" -} diff --git a/hphp/test/slow/array_escalation/381.php b/hphp/test/slow/array_escalation/381.php deleted file mode 100644 index 8d60187ed4f..00000000000 --- a/hphp/test/slow/array_escalation/381.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_381() { -$a = varray[10]; - $a += darray['c' => varray[3]]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/381.php.expect b/hphp/test/slow/array_escalation/381.php.expect deleted file mode 100644 index 3a93f3ce35c..00000000000 --- a/hphp/test/slow/array_escalation/381.php.expect +++ /dev/null @@ -1,9 +0,0 @@ -array(2) { - [0]=> - int(10) - ["c"]=> - array(1) { - [0]=> - int(3) - } -} diff --git a/hphp/test/slow/array_escalation/382.php b/hphp/test/slow/array_escalation/382.php deleted file mode 100644 index 630213f8bbc..00000000000 --- a/hphp/test/slow/array_escalation/382.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_382() { -$a = varray['test']; - $a += varray[]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/382.php.expect b/hphp/test/slow/array_escalation/382.php.expect deleted file mode 100644 index 343e0ba2644..00000000000 --- a/hphp/test/slow/array_escalation/382.php.expect +++ /dev/null @@ -1,4 +0,0 @@ -array(1) { - [0]=> - string(4) "test" -} diff --git a/hphp/test/slow/array_escalation/383.php b/hphp/test/slow/array_escalation/383.php deleted file mode 100644 index d365053fc18..00000000000 --- a/hphp/test/slow/array_escalation/383.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_383() { -$a = varray['test']; - $a += varray[20]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/383.php.expect b/hphp/test/slow/array_escalation/383.php.expect deleted file mode 100644 index 343e0ba2644..00000000000 --- a/hphp/test/slow/array_escalation/383.php.expect +++ /dev/null @@ -1,4 +0,0 @@ -array(1) { - [0]=> - string(4) "test" -} diff --git a/hphp/test/slow/array_escalation/384.php b/hphp/test/slow/array_escalation/384.php deleted file mode 100644 index 808a9c6ee1f..00000000000 --- a/hphp/test/slow/array_escalation/384.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_384() { -$a = varray['test']; - $a += varray['b']; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/384.php.expect b/hphp/test/slow/array_escalation/384.php.expect deleted file mode 100644 index 343e0ba2644..00000000000 --- a/hphp/test/slow/array_escalation/384.php.expect +++ /dev/null @@ -1,4 +0,0 @@ -array(1) { - [0]=> - string(4) "test" -} diff --git a/hphp/test/slow/array_escalation/385.php b/hphp/test/slow/array_escalation/385.php deleted file mode 100644 index 75d92211de0..00000000000 --- a/hphp/test/slow/array_escalation/385.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_385() { -$a = varray['test']; - $a += varray[varray[3]]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/385.php.expect b/hphp/test/slow/array_escalation/385.php.expect deleted file mode 100644 index 343e0ba2644..00000000000 --- a/hphp/test/slow/array_escalation/385.php.expect +++ /dev/null @@ -1,4 +0,0 @@ -array(1) { - [0]=> - string(4) "test" -} diff --git a/hphp/test/slow/array_escalation/386.php b/hphp/test/slow/array_escalation/386.php deleted file mode 100644 index 70444e539c0..00000000000 --- a/hphp/test/slow/array_escalation/386.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_386() { -$a = varray['test']; - $a += darray['c' => 20]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/386.php.expect b/hphp/test/slow/array_escalation/386.php.expect deleted file mode 100644 index 6900e6c6053..00000000000 --- a/hphp/test/slow/array_escalation/386.php.expect +++ /dev/null @@ -1,6 +0,0 @@ -array(2) { - [0]=> - string(4) "test" - ["c"]=> - int(20) -} diff --git a/hphp/test/slow/array_escalation/387.php b/hphp/test/slow/array_escalation/387.php deleted file mode 100644 index 6b217d8cad2..00000000000 --- a/hphp/test/slow/array_escalation/387.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_387() { -$a = varray['test']; - $a += darray['c' => 'b']; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/387.php.expect b/hphp/test/slow/array_escalation/387.php.expect deleted file mode 100644 index 1b328cc385d..00000000000 --- a/hphp/test/slow/array_escalation/387.php.expect +++ /dev/null @@ -1,6 +0,0 @@ -array(2) { - [0]=> - string(4) "test" - ["c"]=> - string(1) "b" -} diff --git a/hphp/test/slow/array_escalation/388.php b/hphp/test/slow/array_escalation/388.php deleted file mode 100644 index 6816ffb9b98..00000000000 --- a/hphp/test/slow/array_escalation/388.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_388() { -$a = varray['test']; - $a += darray['c' => varray[3]]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/388.php.expect b/hphp/test/slow/array_escalation/388.php.expect deleted file mode 100644 index 13479023df8..00000000000 --- a/hphp/test/slow/array_escalation/388.php.expect +++ /dev/null @@ -1,9 +0,0 @@ -array(2) { - [0]=> - string(4) "test" - ["c"]=> - array(1) { - [0]=> - int(3) - } -} diff --git a/hphp/test/slow/array_escalation/389.php b/hphp/test/slow/array_escalation/389.php deleted file mode 100644 index 8175ba01069..00000000000 --- a/hphp/test/slow/array_escalation/389.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_389() { -$a = varray[varray[0]]; - $a += varray[]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/389.php.expect b/hphp/test/slow/array_escalation/389.php.expect deleted file mode 100644 index 74112e917f9..00000000000 --- a/hphp/test/slow/array_escalation/389.php.expect +++ /dev/null @@ -1,7 +0,0 @@ -array(1) { - [0]=> - array(1) { - [0]=> - int(0) - } -} diff --git a/hphp/test/slow/array_escalation/390.php b/hphp/test/slow/array_escalation/390.php deleted file mode 100644 index 8ea4ffad5fe..00000000000 --- a/hphp/test/slow/array_escalation/390.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_390() { -$a = varray[varray[0]]; - $a += varray[20]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/390.php.expect b/hphp/test/slow/array_escalation/390.php.expect deleted file mode 100644 index 74112e917f9..00000000000 --- a/hphp/test/slow/array_escalation/390.php.expect +++ /dev/null @@ -1,7 +0,0 @@ -array(1) { - [0]=> - array(1) { - [0]=> - int(0) - } -} diff --git a/hphp/test/slow/array_escalation/391.php b/hphp/test/slow/array_escalation/391.php deleted file mode 100644 index bf51e52573c..00000000000 --- a/hphp/test/slow/array_escalation/391.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_391() { -$a = varray[varray[0]]; - $a += varray['b']; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/391.php.expect b/hphp/test/slow/array_escalation/391.php.expect deleted file mode 100644 index 74112e917f9..00000000000 --- a/hphp/test/slow/array_escalation/391.php.expect +++ /dev/null @@ -1,7 +0,0 @@ -array(1) { - [0]=> - array(1) { - [0]=> - int(0) - } -} diff --git a/hphp/test/slow/array_escalation/392.php b/hphp/test/slow/array_escalation/392.php deleted file mode 100644 index b34a9564dc9..00000000000 --- a/hphp/test/slow/array_escalation/392.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_392() { -$a = varray[varray[0]]; - $a += varray[varray[3]]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/392.php.expect b/hphp/test/slow/array_escalation/392.php.expect deleted file mode 100644 index 74112e917f9..00000000000 --- a/hphp/test/slow/array_escalation/392.php.expect +++ /dev/null @@ -1,7 +0,0 @@ -array(1) { - [0]=> - array(1) { - [0]=> - int(0) - } -} diff --git a/hphp/test/slow/array_escalation/393.php b/hphp/test/slow/array_escalation/393.php deleted file mode 100644 index 75ddfe5179a..00000000000 --- a/hphp/test/slow/array_escalation/393.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_393() { -$a = varray[varray[0]]; - $a += darray['c' => 20]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/393.php.expect b/hphp/test/slow/array_escalation/393.php.expect deleted file mode 100644 index cf4c2e559a5..00000000000 --- a/hphp/test/slow/array_escalation/393.php.expect +++ /dev/null @@ -1,9 +0,0 @@ -array(2) { - [0]=> - array(1) { - [0]=> - int(0) - } - ["c"]=> - int(20) -} diff --git a/hphp/test/slow/array_escalation/394.php b/hphp/test/slow/array_escalation/394.php deleted file mode 100644 index e420d0db8b9..00000000000 --- a/hphp/test/slow/array_escalation/394.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_394() { -$a = varray[varray[0]]; - $a += darray['c' => 'b']; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/394.php.expect b/hphp/test/slow/array_escalation/394.php.expect deleted file mode 100644 index 694440875b8..00000000000 --- a/hphp/test/slow/array_escalation/394.php.expect +++ /dev/null @@ -1,9 +0,0 @@ -array(2) { - [0]=> - array(1) { - [0]=> - int(0) - } - ["c"]=> - string(1) "b" -} diff --git a/hphp/test/slow/array_escalation/395.php b/hphp/test/slow/array_escalation/395.php deleted file mode 100644 index cf87f1b446b..00000000000 --- a/hphp/test/slow/array_escalation/395.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_395() { -$a = varray[varray[0]]; - $a += darray['c' => varray[3]]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/395.php.expect b/hphp/test/slow/array_escalation/395.php.expect deleted file mode 100644 index 4cddacc5e8e..00000000000 --- a/hphp/test/slow/array_escalation/395.php.expect +++ /dev/null @@ -1,12 +0,0 @@ -array(2) { - [0]=> - array(1) { - [0]=> - int(0) - } - ["c"]=> - array(1) { - [0]=> - int(3) - } -} diff --git a/hphp/test/slow/array_escalation/396.php b/hphp/test/slow/array_escalation/396.php deleted file mode 100644 index e04213bf243..00000000000 --- a/hphp/test/slow/array_escalation/396.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_396() { -$a = darray['a' => 10]; - $a += varray[]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/396.php.expect b/hphp/test/slow/array_escalation/396.php.expect deleted file mode 100644 index 1411e64337b..00000000000 --- a/hphp/test/slow/array_escalation/396.php.expect +++ /dev/null @@ -1,4 +0,0 @@ -array(1) { - ["a"]=> - int(10) -} diff --git a/hphp/test/slow/array_escalation/397.php b/hphp/test/slow/array_escalation/397.php deleted file mode 100644 index 6c48f03f5e9..00000000000 --- a/hphp/test/slow/array_escalation/397.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_397() { -$a = darray['a' => 10]; - $a += varray[20]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/397.php.expect b/hphp/test/slow/array_escalation/397.php.expect deleted file mode 100644 index 8eae3128af8..00000000000 --- a/hphp/test/slow/array_escalation/397.php.expect +++ /dev/null @@ -1,6 +0,0 @@ -array(2) { - ["a"]=> - int(10) - [0]=> - int(20) -} diff --git a/hphp/test/slow/array_escalation/398.php b/hphp/test/slow/array_escalation/398.php deleted file mode 100644 index ee83f3d56ad..00000000000 --- a/hphp/test/slow/array_escalation/398.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_398() { -$a = darray['a' => 10]; - $a += varray['b']; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/398.php.expect b/hphp/test/slow/array_escalation/398.php.expect deleted file mode 100644 index 6ef3d283278..00000000000 --- a/hphp/test/slow/array_escalation/398.php.expect +++ /dev/null @@ -1,6 +0,0 @@ -array(2) { - ["a"]=> - int(10) - [0]=> - string(1) "b" -} diff --git a/hphp/test/slow/array_escalation/399.php b/hphp/test/slow/array_escalation/399.php deleted file mode 100644 index 71a21d46a5d..00000000000 --- a/hphp/test/slow/array_escalation/399.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_399() { -$a = darray['a' => 10]; - $a += varray[varray[3]]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/399.php.expect b/hphp/test/slow/array_escalation/399.php.expect deleted file mode 100644 index 25eac3e0849..00000000000 --- a/hphp/test/slow/array_escalation/399.php.expect +++ /dev/null @@ -1,9 +0,0 @@ -array(2) { - ["a"]=> - int(10) - [0]=> - array(1) { - [0]=> - int(3) - } -} diff --git a/hphp/test/slow/array_escalation/400.php b/hphp/test/slow/array_escalation/400.php deleted file mode 100644 index de1ba0dfd7b..00000000000 --- a/hphp/test/slow/array_escalation/400.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_400() { -$a = darray['a' => 10]; - $a += darray['c' => 20]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/400.php.expect b/hphp/test/slow/array_escalation/400.php.expect deleted file mode 100644 index f2948afe43f..00000000000 --- a/hphp/test/slow/array_escalation/400.php.expect +++ /dev/null @@ -1,6 +0,0 @@ -array(2) { - ["a"]=> - int(10) - ["c"]=> - int(20) -} diff --git a/hphp/test/slow/array_escalation/401.php b/hphp/test/slow/array_escalation/401.php deleted file mode 100644 index 62575098bc8..00000000000 --- a/hphp/test/slow/array_escalation/401.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_401() { -$a = darray['a' => 10]; - $a += darray['c' => 'b']; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/401.php.expect b/hphp/test/slow/array_escalation/401.php.expect deleted file mode 100644 index 5ecfc20e508..00000000000 --- a/hphp/test/slow/array_escalation/401.php.expect +++ /dev/null @@ -1,6 +0,0 @@ -array(2) { - ["a"]=> - int(10) - ["c"]=> - string(1) "b" -} diff --git a/hphp/test/slow/array_escalation/402.php b/hphp/test/slow/array_escalation/402.php deleted file mode 100644 index 03b3fb2303a..00000000000 --- a/hphp/test/slow/array_escalation/402.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_402() { -$a = darray['a' => 10]; - $a += darray['c' => varray[3]]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/402.php.expect b/hphp/test/slow/array_escalation/402.php.expect deleted file mode 100644 index 75cc87a78ce..00000000000 --- a/hphp/test/slow/array_escalation/402.php.expect +++ /dev/null @@ -1,9 +0,0 @@ -array(2) { - ["a"]=> - int(10) - ["c"]=> - array(1) { - [0]=> - int(3) - } -} diff --git a/hphp/test/slow/array_escalation/403.php b/hphp/test/slow/array_escalation/403.php deleted file mode 100644 index 3f236e71288..00000000000 --- a/hphp/test/slow/array_escalation/403.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_403() { -$a = darray['a' => 'va']; - $a += varray[]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/403.php.expect b/hphp/test/slow/array_escalation/403.php.expect deleted file mode 100644 index f42bca5babb..00000000000 --- a/hphp/test/slow/array_escalation/403.php.expect +++ /dev/null @@ -1,4 +0,0 @@ -array(1) { - ["a"]=> - string(2) "va" -} diff --git a/hphp/test/slow/array_escalation/404.php b/hphp/test/slow/array_escalation/404.php deleted file mode 100644 index 6d7340df8c5..00000000000 --- a/hphp/test/slow/array_escalation/404.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_404() { -$a = darray['a' => 'va']; - $a += varray[20]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/404.php.expect b/hphp/test/slow/array_escalation/404.php.expect deleted file mode 100644 index 0dbfcc16019..00000000000 --- a/hphp/test/slow/array_escalation/404.php.expect +++ /dev/null @@ -1,6 +0,0 @@ -array(2) { - ["a"]=> - string(2) "va" - [0]=> - int(20) -} diff --git a/hphp/test/slow/array_escalation/405.php b/hphp/test/slow/array_escalation/405.php deleted file mode 100644 index bc4207cb383..00000000000 --- a/hphp/test/slow/array_escalation/405.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_405() { -$a = darray['a' => 'va']; - $a += varray['b']; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/405.php.expect b/hphp/test/slow/array_escalation/405.php.expect deleted file mode 100644 index dd66a819c66..00000000000 --- a/hphp/test/slow/array_escalation/405.php.expect +++ /dev/null @@ -1,6 +0,0 @@ -array(2) { - ["a"]=> - string(2) "va" - [0]=> - string(1) "b" -} diff --git a/hphp/test/slow/array_escalation/406.php b/hphp/test/slow/array_escalation/406.php deleted file mode 100644 index 900a517fd88..00000000000 --- a/hphp/test/slow/array_escalation/406.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_406() { -$a = darray['a' => 'va']; - $a += varray[varray[3]]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/406.php.expect b/hphp/test/slow/array_escalation/406.php.expect deleted file mode 100644 index 835676b54e0..00000000000 --- a/hphp/test/slow/array_escalation/406.php.expect +++ /dev/null @@ -1,9 +0,0 @@ -array(2) { - ["a"]=> - string(2) "va" - [0]=> - array(1) { - [0]=> - int(3) - } -} diff --git a/hphp/test/slow/array_escalation/407.php b/hphp/test/slow/array_escalation/407.php deleted file mode 100644 index f710a138e03..00000000000 --- a/hphp/test/slow/array_escalation/407.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_407() { -$a = darray['a' => 'va']; - $a += darray['c' => 20]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/407.php.expect b/hphp/test/slow/array_escalation/407.php.expect deleted file mode 100644 index da0acec386d..00000000000 --- a/hphp/test/slow/array_escalation/407.php.expect +++ /dev/null @@ -1,6 +0,0 @@ -array(2) { - ["a"]=> - string(2) "va" - ["c"]=> - int(20) -} diff --git a/hphp/test/slow/array_escalation/408.php b/hphp/test/slow/array_escalation/408.php deleted file mode 100644 index ce11ac287fd..00000000000 --- a/hphp/test/slow/array_escalation/408.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_408() { -$a = darray['a' => 'va']; - $a += darray['c' => 'b']; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/408.php.expect b/hphp/test/slow/array_escalation/408.php.expect deleted file mode 100644 index 6784629ba74..00000000000 --- a/hphp/test/slow/array_escalation/408.php.expect +++ /dev/null @@ -1,6 +0,0 @@ -array(2) { - ["a"]=> - string(2) "va" - ["c"]=> - string(1) "b" -} diff --git a/hphp/test/slow/array_escalation/409.php b/hphp/test/slow/array_escalation/409.php deleted file mode 100644 index d76a5fe33d6..00000000000 --- a/hphp/test/slow/array_escalation/409.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_409() { -$a = darray['a' => 'va']; - $a += darray['c' => varray[3]]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/409.php.expect b/hphp/test/slow/array_escalation/409.php.expect deleted file mode 100644 index 684429a1815..00000000000 --- a/hphp/test/slow/array_escalation/409.php.expect +++ /dev/null @@ -1,9 +0,0 @@ -array(2) { - ["a"]=> - string(2) "va" - ["c"]=> - array(1) { - [0]=> - int(3) - } -} diff --git a/hphp/test/slow/array_escalation/410.php b/hphp/test/slow/array_escalation/410.php deleted file mode 100644 index da5deb75704..00000000000 --- a/hphp/test/slow/array_escalation/410.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_410() { -$a = darray['a' => varray[1]]; - $a += varray[]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/410.php.expect b/hphp/test/slow/array_escalation/410.php.expect deleted file mode 100644 index ad8b7a439e2..00000000000 --- a/hphp/test/slow/array_escalation/410.php.expect +++ /dev/null @@ -1,7 +0,0 @@ -array(1) { - ["a"]=> - array(1) { - [0]=> - int(1) - } -} diff --git a/hphp/test/slow/array_escalation/411.php b/hphp/test/slow/array_escalation/411.php deleted file mode 100644 index 810a72fa947..00000000000 --- a/hphp/test/slow/array_escalation/411.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_411() { -$a = darray['a' => varray[1]]; - $a += varray[20]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/411.php.expect b/hphp/test/slow/array_escalation/411.php.expect deleted file mode 100644 index 19310ab4a10..00000000000 --- a/hphp/test/slow/array_escalation/411.php.expect +++ /dev/null @@ -1,9 +0,0 @@ -array(2) { - ["a"]=> - array(1) { - [0]=> - int(1) - } - [0]=> - int(20) -} diff --git a/hphp/test/slow/array_escalation/412.php b/hphp/test/slow/array_escalation/412.php deleted file mode 100644 index d85d257510b..00000000000 --- a/hphp/test/slow/array_escalation/412.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_412() { -$a = darray['a' => varray[1]]; - $a += varray['b']; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/412.php.expect b/hphp/test/slow/array_escalation/412.php.expect deleted file mode 100644 index 19ebde28b35..00000000000 --- a/hphp/test/slow/array_escalation/412.php.expect +++ /dev/null @@ -1,9 +0,0 @@ -array(2) { - ["a"]=> - array(1) { - [0]=> - int(1) - } - [0]=> - string(1) "b" -} diff --git a/hphp/test/slow/array_escalation/413.php b/hphp/test/slow/array_escalation/413.php deleted file mode 100644 index 9abd092b46e..00000000000 --- a/hphp/test/slow/array_escalation/413.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_413() { -$a = darray['a' => varray[1]]; - $a += varray[varray[3]]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/413.php.expect b/hphp/test/slow/array_escalation/413.php.expect deleted file mode 100644 index ab5f5b285a3..00000000000 --- a/hphp/test/slow/array_escalation/413.php.expect +++ /dev/null @@ -1,12 +0,0 @@ -array(2) { - ["a"]=> - array(1) { - [0]=> - int(1) - } - [0]=> - array(1) { - [0]=> - int(3) - } -} diff --git a/hphp/test/slow/array_escalation/414.php b/hphp/test/slow/array_escalation/414.php deleted file mode 100644 index 885418ebb13..00000000000 --- a/hphp/test/slow/array_escalation/414.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_414() { -$a = darray['a' => varray[1]]; - $a += darray['c' => 20]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/414.php.expect b/hphp/test/slow/array_escalation/414.php.expect deleted file mode 100644 index a94c3726273..00000000000 --- a/hphp/test/slow/array_escalation/414.php.expect +++ /dev/null @@ -1,9 +0,0 @@ -array(2) { - ["a"]=> - array(1) { - [0]=> - int(1) - } - ["c"]=> - int(20) -} diff --git a/hphp/test/slow/array_escalation/415.php b/hphp/test/slow/array_escalation/415.php deleted file mode 100644 index e33fadb521c..00000000000 --- a/hphp/test/slow/array_escalation/415.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_415() { -$a = darray['a' => varray[1]]; - $a += darray['c' => 'b']; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/415.php.expect b/hphp/test/slow/array_escalation/415.php.expect deleted file mode 100644 index e6f02adce86..00000000000 --- a/hphp/test/slow/array_escalation/415.php.expect +++ /dev/null @@ -1,9 +0,0 @@ -array(2) { - ["a"]=> - array(1) { - [0]=> - int(1) - } - ["c"]=> - string(1) "b" -} diff --git a/hphp/test/slow/array_escalation/416.php b/hphp/test/slow/array_escalation/416.php deleted file mode 100644 index d9a3fb18a27..00000000000 --- a/hphp/test/slow/array_escalation/416.php +++ /dev/null @@ -1,9 +0,0 @@ -> -function main_416() { -$a = darray['a' => varray[1]]; - $a += darray['c' => varray[3]]; - var_dump($a); -} diff --git a/hphp/test/slow/array_escalation/416.php.expect b/hphp/test/slow/array_escalation/416.php.expect deleted file mode 100644 index caa754a7511..00000000000 --- a/hphp/test/slow/array_escalation/416.php.expect +++ /dev/null @@ -1,12 +0,0 @@ -array(2) { - ["a"]=> - array(1) { - [0]=> - int(1) - } - ["c"]=> - array(1) { - [0]=> - int(3) - } -} diff --git a/hphp/test/slow/compilation/1297.php b/hphp/test/slow/compilation/1297.php deleted file mode 100644 index 0af698b81ad..00000000000 --- a/hphp/test/slow/compilation/1297.php +++ /dev/null @@ -1,7 +0,0 @@ -> -function main_1297() { -var_dump(varray[1,2,3]+varray[4,5,6]); -} diff --git a/hphp/test/slow/compilation/1297.php.expect b/hphp/test/slow/compilation/1297.php.expect deleted file mode 100644 index 468e3cd4225..00000000000 --- a/hphp/test/slow/compilation/1297.php.expect +++ /dev/null @@ -1,8 +0,0 @@ -array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) -} diff --git a/hphp/test/slow/ext_apc/4.php b/hphp/test/slow/ext_apc/4.php index 2ffc008f592..2c83a55b1e6 100644 --- a/hphp/test/slow/ext_apc/4.php +++ b/hphp/test/slow/ext_apc/4.php @@ -13,8 +13,8 @@ if ($apcdata !== darray["a" => "test", "b" => 3]) echo "no\n"; unset($apcdata); $apcdata = __hhvm_intrinsics\apc_fetch_no_check("apcdata"); -$apcdata += darray["b" => 4]; // problem -if ($apcdata !== darray["a" => "test", "b" => 1]) echo "no\n"; +$apcdata["b"] = 4; +if ($apcdata !== darray["a" => "test", "b" => 4]) echo "no\n"; unset($apcdata); $apcdata = __hhvm_intrinsics\apc_fetch_no_check(varray["apcdata", "nah"]); diff --git a/hphp/test/slow/ext_array/array_merge.php b/hphp/test/slow/ext_array/array_merge.php index c8e6e385627..e41a897a29c 100644 --- a/hphp/test/slow/ext_array/array_merge.php +++ b/hphp/test/slow/ext_array/array_merge.php @@ -27,7 +27,7 @@ function b() { function c() { $array1 = varray[]; $array2 = darray[1 => "data"]; - $result = $array1 + $array2; + $result = array_merge($array1, $array2); var_dump($result); } diff --git a/hphp/test/slow/ext_array/array_merge.php.expect b/hphp/test/slow/ext_array/array_merge.php.expect index 678b89af0a9..48d23db31b6 100644 --- a/hphp/test/slow/ext_array/array_merge.php.expect +++ b/hphp/test/slow/ext_array/array_merge.php.expect @@ -27,7 +27,7 @@ array(1) { } } array(1) { - [1]=> + [0]=> string(4) "data" } array(2) { diff --git a/hphp/test/slow/ext_array/array_replace.php b/hphp/test/slow/ext_array/array_replace.php index 30e43de26a0..c31512d2b6c 100644 --- a/hphp/test/slow/ext_array/array_replace.php +++ b/hphp/test/slow/ext_array/array_replace.php @@ -27,7 +27,7 @@ function b() { function c() { $array1 = varray[]; $array2 = darray[1 => "data"]; - $result = $array1 + $array2; + $result = array_merge($array1, $array2); var_dump($result); } diff --git a/hphp/test/slow/ext_array/array_replace.php.expect b/hphp/test/slow/ext_array/array_replace.php.expect index 6106a5653a6..2f66afc0b5e 100644 --- a/hphp/test/slow/ext_array/array_replace.php.expect +++ b/hphp/test/slow/ext_array/array_replace.php.expect @@ -25,7 +25,7 @@ array(1) { } } array(1) { - [1]=> + [0]=> string(4) "data" } array(1) { diff --git a/hphp/test/slow/hack_arr_compat/add.php b/hphp/test/slow/hack_arr_compat/add.php index 53fb0a0ad1a..dbbbcff477b 100644 --- a/hphp/test/slow/hack_arr_compat/add.php +++ b/hphp/test/slow/hack_arr_compat/add.php @@ -2,7 +2,7 @@ // Copyright 2004-present Facebook. All Rights Reserved. function do_add($a, $b) { - var_dump($a + $b); + try { var_dump($a + $b); } catch (Exception $e) { print($e->getMessage()."\n"); } } function main() { diff --git a/hphp/test/slow/hack_arr_compat/add.php.expectf b/hphp/test/slow/hack_arr_compat/add.php.expectf dissimilarity index 100% index d93d63cf14f..9aef13d64d9 100644 --- a/hphp/test/slow/hack_arr_compat/add.php.expectf +++ b/hphp/test/slow/hack_arr_compat/add.php.expectf @@ -1,34 +1,4 @@ - -Notice: Hack Array Compat: Using + operator on arrays in %s on line %d -array(0) { -} - -Notice: Hack Array Compat: Using + operator on arrays in %s on line %d -array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) -} - -Notice: Hack Array Compat: Using + operator on arrays in %s on line %d -array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) -} - -Notice: Hack Array Compat: Using + operator on arrays in %s on line %d -array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) -} +Arrays do not support the + operator +Arrays do not support the + operator +Arrays do not support the + operator +Arrays do not support the + operator diff --git a/hphp/test/slow/hack_arr_compat/scalars.php b/hphp/test/slow/hack_arr_compat/scalars.php index 684cd9d648a..fb51887c7e2 100644 --- a/hphp/test/slow/hack_arr_compat/scalars.php +++ b/hphp/test/slow/hack_arr_compat/scalars.php @@ -23,11 +23,6 @@ function test_cmp() { wrap(() ==> true <=> __hhvm_intrinsics\dummy_cast_to_kindofarray(vec[1, 2, 3]), __LINE__); } -function test_add() { - var_dump(__hhvm_intrinsics\dummy_cast_to_kindofarray(vec[1, 2, 3]) + __hhvm_intrinsics\dummy_cast_to_kindofarray(vec[1, 2, 3, 4, 5])); - var_dump(__hhvm_intrinsics\dummy_cast_to_kindofarray(vec[1, 2, 3, 4, 5]) + __hhvm_intrinsics\dummy_cast_to_kindofarray(vec[1, 2, 3])); -} - function test_intlike_keys() { var_dump(__hhvm_intrinsics\dummy_cast_to_kindofarray(dict['0' => 1])); var_dump(__hhvm_intrinsics\dummy_cast_to_kindofarray(dict['0' => 1, 1 => 2, 2 => 3, 3 => 4])); @@ -54,6 +49,5 @@ function wrap($cmp, $lineno) { <<__EntryPoint>> function main_scalars() { test_cmp(); - test_add(); test_intlike_keys(); } diff --git a/hphp/test/slow/hack_arr_compat/scalars.php.expectf b/hphp/test/slow/hack_arr_compat/scalars.php.expectf index d10de6d816a..fe640aae923 100644 --- a/hphp/test/slow/hack_arr_compat/scalars.php.expectf +++ b/hphp/test/slow/hack_arr_compat/scalars.php.expectf @@ -41,34 +41,6 @@ Caught: Cannot use relational comparison operators (<, <=, >, >=, <=>) to compar Caught: Cannot use relational comparison operators (<, <=, >, >=, <=>) to compare a PHP array with a non-array on line 22 Caught: Cannot use relational comparison operators (<, <=, >, >=, <=>) to compare a PHP array with a non-array on line 23 - -Notice: Hack Array Compat: Using + operator on arrays in %s/scalars.php on line 27 -array(5) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) -} - -Notice: Hack Array Compat: Using + operator on arrays in %s/scalars.php on line 28 -array(5) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) -} array(1) { ["0"]=> int(1) diff --git a/hphp/test/slow/hack_arr_compat/split_misc_notices.php b/hphp/test/slow/hack_arr_compat/split_misc_notices.php index 4974ae46aa2..c4771c863f0 100644 --- a/hphp/test/slow/hack_arr_compat/split_misc_notices.php +++ b/hphp/test/slow/hack_arr_compat/split_misc_notices.php @@ -3,5 +3,9 @@ <<__EntryPoint>> function main () { $a = darray["" => "empty string", 1 => "one", 0 => "zero"]; - var_dump($a + darray["more stuff" => "yep"]); + try { + var_dump($a + darray["more stuff" => "yep"]); + } catch (Exception $e) { + print($e->getMessage())."\n"; + } } diff --git a/hphp/test/slow/hack_arr_compat/split_misc_notices.php.expectf b/hphp/test/slow/hack_arr_compat/split_misc_notices.php.expectf index 37567785ba3..5cc168beb71 100644 --- a/hphp/test/slow/hack_arr_compat/split_misc_notices.php.expectf +++ b/hphp/test/slow/hack_arr_compat/split_misc_notices.php.expectf @@ -1,10 +1 @@ -array(4) { - [""]=> - string(12) "empty string" - [1]=> - string(3) "one" - [0]=> - string(4) "zero" - ["more stuff"]=> - string(3) "yep" -} +Arrays do not support the + operator diff --git a/hphp/test/slow/hack_arr_compat/split_misc_notices_2.php b/hphp/test/slow/hack_arr_compat/split_misc_notices_2.php index 4974ae46aa2..95361c404ae 100644 --- a/hphp/test/slow/hack_arr_compat/split_misc_notices_2.php +++ b/hphp/test/slow/hack_arr_compat/split_misc_notices_2.php @@ -3,5 +3,9 @@ <<__EntryPoint>> function main () { $a = darray["" => "empty string", 1 => "one", 0 => "zero"]; - var_dump($a + darray["more stuff" => "yep"]); + try { + var_dump($a + darray["more stuff" => "yep"]); + } catch (Exception $e) { + print($e->getMessage()."\n"); + } } diff --git a/hphp/test/slow/hack_arr_compat/split_misc_notices_2.php.expectf b/hphp/test/slow/hack_arr_compat/split_misc_notices_2.php.expectf index d62c6e8c3b0..5cc168beb71 100644 --- a/hphp/test/slow/hack_arr_compat/split_misc_notices_2.php.expectf +++ b/hphp/test/slow/hack_arr_compat/split_misc_notices_2.php.expectf @@ -1,12 +1 @@ - -Notice: Hack Array Compat: Using + operator on arrays in %s on line %d -array(4) { - [""]=> - string(12) "empty string" - [1]=> - string(3) "one" - [0]=> - string(4) "zero" - ["more stuff"]=> - string(3) "yep" -} +Arrays do not support the + operator diff --git a/hphp/test/slow/hack_array_pluseq.php b/hphp/test/slow/hack_array_pluseq.php deleted file mode 100644 index 2ce769df75f..00000000000 --- a/hphp/test/slow/hack_array_pluseq.php +++ /dev/null @@ -1,59 +0,0 @@ -getMessage() . "\n"; - } -} - - -<<__EntryPoint>> -function main_hack_array_pluseq() { -$a1 = varray[1, 2, 3]; -$a2 = varray["1", "b", "c"]; - -$v1 = vec[1, 2, 3]; -$d1 = dict['a' => 1, 'b' => 2, 'c' => 3]; -$k1 = keyset[1, 2, 3]; - -main(vec[], $a1, $a2); -main(dict[], $a1, $a2); -main(keyset[], $a1, $a2); - -main(vec[], varray[], varray[]); -main(dict[], darray[], darray[]); -main(keyset[], varray[], varray[]); - -main($v1, $a1, $a2); -main($d1, $a1, $a2); -main($k1, $a1, $a2); - -main($v1, varray[], varray[]); -main($d1, darray[], darray[]); -main($k1, varray[], varray[]); - -main($a1, vec[], $v1); -main($a1, dict[], $d1); -main($a1, keyset[], $k1); - -main($a1, $v1, vec[]); -main($a1, $d1, dict[]); -main($a1, $k1, keyset[]); - -main(varray[], vec[], $v1); -main(darray[], dict[], $d1); -main(varray[], keyset[], $k1); - -main(varray[], $v1, vec[]); -main(darray[], $d1, dict[]); -main(varray[], $k1, keyset[]); -} diff --git a/hphp/test/slow/hack_array_pluseq.php.expect b/hphp/test/slow/hack_array_pluseq.php.expect deleted file mode 100644 index 0dadb0167b6..00000000000 --- a/hphp/test/slow/hack_array_pluseq.php.expect +++ /dev/null @@ -1,24 +0,0 @@ -Vecs do not support the + operator -Dicts do not support the + operator -Keysets do not support the + operator -Vecs do not support the + operator -Dicts do not support the + operator -Keysets do not support the + operator -Vecs do not support the + operator -Dicts do not support the + operator -Keysets do not support the + operator -Vecs do not support the + operator -Dicts do not support the + operator -Keysets do not support the + operator -Vecs do not support the + operator -Dicts do not support the + operator -Keysets do not support the + operator -Vecs do not support the + operator -Dicts do not support the + operator -Keysets do not support the + operator -Vecs do not support the + operator -Dicts do not support the + operator -Keysets do not support the + operator -Vecs do not support the + operator -Dicts do not support the + operator -Keysets do not support the + operator diff --git a/hphp/test/slow/ir_inlining/nested-calls-redefsp-1.php b/hphp/test/slow/ir_inlining/nested-calls-redefsp-1.php index 2b5c3679268..76af14fe9ab 100644 --- a/hphp/test/slow/ir_inlining/nested-calls-redefsp-1.php +++ b/hphp/test/slow/ir_inlining/nested-calls-redefsp-1.php @@ -28,7 +28,7 @@ class MyThing { function doThings() { for ($i = 0; $i < 10; ++$i) mt_rand(); $params = darray['duration' => $this->duration]; - return $this->getModeQueryData() + $params; + return array_merge($this->getModeQueryData(), $params); } function c() { diff --git a/hphp/test/slow/php7_backported/varSyntax/issetOnTemp.php b/hphp/test/slow/php7_backported/varSyntax/issetOnTemp.php index 69d15acb0c2..6c6b24dfbbb 100644 --- a/hphp/test/slow/php7_backported/varSyntax/issetOnTemp.php +++ b/hphp/test/slow/php7_backported/varSyntax/issetOnTemp.php @@ -3,14 +3,14 @@ <<__EntryPoint>> function main_isset_on_temp() { var_dump(isset(varray[0, 1][0])); -var_dump(isset((varray[0, 1] + varray[])[0])); +var_dump(isset((varray[0, 1]))); var_dump(isset(varray[varray[0, 1]][0][0])); -var_dump(isset((varray[varray[0, 1]] + varray[])[0][0])); +var_dump(isset((varray[varray[0, 1]])[0][0])); $o = new stdClass(); $o->a = 'b'; var_dump(isset($o->a)); //var_dump(isset(['a' => 'b']->a)); //var_dump(isset("str"->a)); -var_dump(isset((darray['a' => 'b'] + darray[])->a)); -var_dump(isset((darray['a' => 'b'] + darray[])->a->b)); +var_dump(isset((darray['a' => 'b'])->a)); +var_dump(isset((darray['a' => 'b'])->a->b)); } diff --git a/hphp/test/slow/spec/tests/expressions/additive_operators/array_concatenation.php b/hphp/test/slow/spec/tests/expressions/additive_operators/array_concatenation.php deleted file mode 100644 index 1a92a14d0f1..00000000000 --- a/hphp/test/slow/spec/tests/expressions/additive_operators/array_concatenation.php +++ /dev/null @@ -1,61 +0,0 @@ -> function main(): void { - -///* -$oper = varray[darray[0 => 1, 5 => FALSE, 6 => "red"], varray[NULL], darray[4 => -5, 5 => 1.23]]; - -foreach ($oper as $e1) -{ - foreach ($oper as $e2) - { - echo ">Array< + >Array<, result: "; var_dump($e1 + $e2); - } - echo "-------------------------------------\n"; -} -//*/ - -/* -// the following LHS-operands all have "Unsupported operand types" - --10 + [1, 5 => FALSE, "red"]; -3.4e10 + [1, 5 => FALSE, "red"]; -TRUE + [1, 5 => FALSE, "red"]; -NULL + [1, 5 => FALSE, "red"]; -"" + [1, 5 => FALSE, "red"]; -"123" + [1, 5 => FALSE, "red"]; - -// likewise for the following RHS-operands - -[1, 5 => FALSE, "red"] + -10; -[1, 5 => FALSE, "red"] + 3.4e10; -[1, 5 => FALSE, "red"] + TRUE; -[1, 5 => FALSE, "red"] + NULL; -[1, 5 => FALSE, "red"] + ""; -[1, 5 => FALSE, "red"] + "123"; - -// So we conclude that if one operand is an array and the other not, the array -// is not converted to a string and concatenated, and neither is the non-array -// converted to an array and merged with the other array. -*/ - -///* -// show that a new array is created and that the operand-arrays are unchanged - -$a1 = darray[0 => 1, 5 => FALSE, 6 => "red"]; // [0], [5], [6] -$a2 = darray[4 => -5, 5 => 1.23]; // [4], [5] - -$a3 = $a1 + $a2; // [0], [5], [6], [4] -var_dump($a3); -$a3[0] = 11; -$a3[6] = 99; -var_dump($a3); -var_dump($a1); -var_dump($a2); -//*/ -} diff --git a/hphp/test/slow/spec/tests/expressions/additive_operators/array_concatenation.php.expectf b/hphp/test/slow/spec/tests/expressions/additive_operators/array_concatenation.php.expectf deleted file mode 100644 index 4aa2e557698..00000000000 --- a/hphp/test/slow/spec/tests/expressions/additive_operators/array_concatenation.php.expectf +++ /dev/null @@ -1,107 +0,0 @@ ->Array< + >Array<, result: array(3) { - [0]=> - int(1) - [5]=> - bool(false) - [6]=> - string(3) "red" -} ->Array< + >Array<, result: array(3) { - [0]=> - int(1) - [5]=> - bool(false) - [6]=> - string(3) "red" -} ->Array< + >Array<, result: array(4) { - [0]=> - int(1) - [5]=> - bool(false) - [6]=> - string(3) "red" - [4]=> - int(-5) -} -------------------------------------- ->Array< + >Array<, result: array(3) { - [0]=> - NULL - [5]=> - bool(false) - [6]=> - string(3) "red" -} ->Array< + >Array<, result: array(1) { - [0]=> - NULL -} ->Array< + >Array<, result: array(3) { - [0]=> - NULL - [4]=> - int(-5) - [5]=> - float(1.23) -} -------------------------------------- ->Array< + >Array<, result: array(4) { - [4]=> - int(-5) - [5]=> - float(1.23) - [0]=> - int(1) - [6]=> - string(3) "red" -} ->Array< + >Array<, result: array(3) { - [4]=> - int(-5) - [5]=> - float(1.23) - [0]=> - NULL -} ->Array< + >Array<, result: array(2) { - [4]=> - int(-5) - [5]=> - float(1.23) -} -------------------------------------- -array(4) { - [0]=> - int(1) - [5]=> - bool(false) - [6]=> - string(3) "red" - [4]=> - int(-5) -} -array(4) { - [0]=> - int(11) - [5]=> - bool(false) - [6]=> - int(99) - [4]=> - int(-5) -} -array(3) { - [0]=> - int(1) - [5]=> - bool(false) - [6]=> - string(3) "red" -} -array(2) { - [4]=> - int(-5) - [5]=> - float(1.23) -} diff --git a/hphp/test/zend/good/Zend/tests/add_001.php b/hphp/test/zend/good/Zend/tests/add_001.php deleted file mode 100644 index 3317469f5b2..00000000000 --- a/hphp/test/zend/good/Zend/tests/add_001.php +++ /dev/null @@ -1,28 +0,0 @@ -> function main(): void { -$a = varray[1,2,3]; -$b = varray["str", "here"]; - -$c = $a + $b; -var_dump($c); - -$a = varray[1,2,3]; -$b = varray[1,2,4]; - -$c = $a + $b; -var_dump($c); - -$a = darray["a" => "aaa", 0 => 2, 1 => 3]; -$b = darray[0 => 1, 1 => 2, "a" => "bbbbbb"]; - -$c = $a + $b; -var_dump($c); - -$a += $b; -var_dump($c); - -$a += $a; -var_dump($c); - -echo "Done\n"; -} diff --git a/hphp/test/zend/good/Zend/tests/add_001.php.expectf b/hphp/test/zend/good/Zend/tests/add_001.php.expectf deleted file mode 100644 index 603124690ac..00000000000 --- a/hphp/test/zend/good/Zend/tests/add_001.php.expectf +++ /dev/null @@ -1,41 +0,0 @@ -array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) -} -array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) -} -array(3) { - ["a"]=> - string(3) "aaa" - [0]=> - int(2) - [1]=> - int(3) -} -array(3) { - ["a"]=> - string(3) "aaa" - [0]=> - int(2) - [1]=> - int(3) -} -array(3) { - ["a"]=> - string(3) "aaa" - [0]=> - int(2) - [1]=> - int(3) -} -Done \ No newline at end of file -- 2.11.4.GIT