1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-8.2' into PHP-8.3

* PHP-8.2:
  Align error messages between normal VM and JIT for RW when using object as array (#12799)
This commit is contained in:
Dmitry Stogov
2023-11-28 00:40:48 +03:00

View File

@@ -1504,9 +1504,9 @@ ZEND_API bool zend_never_inline zend_verify_class_constant_type(zend_class_const
return 1;
}
static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_use_object_as_array(void)
static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_use_object_as_array(const zend_object *object)
{
zend_throw_error(NULL, "Cannot use object as array");
zend_throw_error(NULL, "Cannot use object of type %s as array", ZSTR_VAL(object->ce->name));
}
static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_illegal_array_offset_access(const zval *offset)
@@ -1584,7 +1584,7 @@ static zend_never_inline void zend_binary_assign_op_obj_dim(zend_object *obj, zv
}
zval_ptr_dtor(&res);
} else {
zend_use_object_as_array();
zend_use_object_as_array(obj);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_NULL(EX_VAR(opline->result.var));
}