Skip to content

Commit 25de668

Browse files
committed
Merge branch 'PHP-8.3'
* PHP-8.3: Align error messages between normal VM and JIT for RW when using object as array (#12799)
2 parents 02bca09 + f4b473c commit 25de668

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Zend/zend_execute.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,9 +1504,9 @@ ZEND_API bool zend_never_inline zend_verify_class_constant_type(zend_class_const
15041504
return 1;
15051505
}
15061506

1507-
static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_use_object_as_array(void)
1507+
static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_use_object_as_array(const zend_object *object)
15081508
{
1509-
zend_throw_error(NULL, "Cannot use object as array");
1509+
zend_throw_error(NULL, "Cannot use object of type %s as array", ZSTR_VAL(object->ce->name));
15101510
}
15111511

15121512
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
15841584
}
15851585
zval_ptr_dtor(&res);
15861586
} else {
1587-
zend_use_object_as_array();
1587+
zend_use_object_as_array(obj);
15881588
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
15891589
ZVAL_NULL(EX_VAR(opline->result.var));
15901590
}

0 commit comments

Comments
 (0)