From e94ab0461cfe948c39ca6aff4377eacc14e7d096 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Mon, 27 Nov 2023 21:37:21 +0000 Subject: [PATCH] Align error messages between normal VM and JIT for RW when using object as array (#12799) --- Zend/zend_execute.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 89610f84b5e..0df529203c1 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -1417,9 +1417,9 @@ static ZEND_COLD void zend_verify_missing_return_type(const zend_function *zf) zend_verify_return_error(zf, NULL); } -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_offset(void) @@ -1487,7 +1487,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)); }