Skip to content

Commit

Permalink
cleanup mixed files
Browse files Browse the repository at this point in the history
  • Loading branch information
mkornaukhov03 committed Nov 6, 2024
1 parent 8124818 commit 7d6a0d4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
3 changes: 0 additions & 3 deletions runtime-common/core/core-types/decl/mixed_decl.inl
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 0 additions & 6 deletions runtime-common/core/core-types/definition/mixed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1074,12 +1074,7 @@ mixed &mixed::operator[](int64_t int_key) {
type_ = type::ARRAY;
new(&as_array()) array<mixed>();
}
else if (get_type() == type::OBJECT) {
auto xxx = from_mixed<class_instance<C$ArrayAccess>>(*this, string());
return empty_value<mixed>();
}
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<mixed>();
}
Expand Down Expand Up @@ -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<class_instance<C$ArrayAccess>>(*this, string());
return f$ArrayAccess$$offsetGet(xxx, string_key);
}
Expand Down

0 comments on commit 7d6a0d4

Please sign in to comment.