From 7d6a0d4bc2851c2d8dba5877d99f7c2688d77161 Mon Sep 17 00:00:00 2001 From: Mikhail Kornaukhov Date: Wed, 6 Nov 2024 18:31:13 +0300 Subject: [PATCH] cleanup mixed files --- runtime-common/core/core-types/decl/mixed_decl.inl | 3 --- runtime-common/core/core-types/definition/mixed.cpp | 6 ------ 2 files changed, 9 deletions(-) diff --git a/runtime-common/core/core-types/decl/mixed_decl.inl b/runtime-common/core/core-types/decl/mixed_decl.inl index dc22e2aea..13968b2c9 100644 --- a/runtime-common/core/core-types/decl/mixed_decl.inl +++ b/runtime-common/core/core-types/decl/mixed_decl.inl @@ -90,9 +90,6 @@ public: mixed &append(const string &v); mixed &append(tmp_string v); - // `operator[]` is used in runtime directly and - // during indirect assignment with macros - // For example, $x[0] = $x[1] = f(); mixed &operator[](int64_t int_key); mixed &operator[](int32_t key) { return (*this)[int64_t{key}]; } mixed &operator[](const string &string_key); diff --git a/runtime-common/core/core-types/definition/mixed.cpp b/runtime-common/core/core-types/definition/mixed.cpp index 0c1ce1c00..b8af63e2a 100644 --- a/runtime-common/core/core-types/definition/mixed.cpp +++ b/runtime-common/core/core-types/definition/mixed.cpp @@ -1074,12 +1074,7 @@ mixed &mixed::operator[](int64_t int_key) { type_ = type::ARRAY; new(&as_array()) array(); } - else if (get_type() == type::OBJECT) { - auto xxx = from_mixed>(*this, string()); - return empty_value(); - } else { - php_warning("type = %d\n", (int)get_type()); php_warning("Cannot use a value \"%s\" of type %s as an array, index = %" PRIi64, to_string_without_warning(*this).c_str(), get_type_or_class_name(), int_key); return empty_value(); } @@ -1334,7 +1329,6 @@ const mixed mixed::get_value(const string &string_key) const { // TODO check with f$is_a if (get_type() == type::OBJECT) { - // printf("Get [\"%s\"]\n", string_key.c_str()); auto xxx = from_mixed>(*this, string()); return f$ArrayAccess$$offsetGet(xxx, string_key); }