Skip to content

Commit d947601

Browse files
committed
More consistent unset error message
1 parent d445bf6 commit d947601

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Zend/zend.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1732,7 +1732,7 @@ ZEND_API ZEND_COLD void zend_illegal_container_offset(const zend_string *contain
17321732
if (zend_string_equals(container, ZSTR_KNOWN(ZEND_STR_STRING))) {
17331733
zend_throw_error(NULL, "Cannot unset string offsets");
17341734
} else {
1735-
zend_type_error("Cannot access offset of type %s in unset", zend_zval_type_name(offset));
1735+
zend_type_error("Cannot unset offset of type %s on %s", zend_zval_type_name(offset), ZSTR_VAL(container));
17361736
}
17371737
return;
17381738
default:

ext/spl/tests/ArrayObject_illegal_offset.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ Cannot access offset of type array on ArrayObject
3636
Cannot access offset of type array on ArrayObject
3737
Cannot access offset of type array on ArrayObject
3838
Cannot access offset of type array in isset or empty
39-
Cannot access offset of type array in unset
39+
Cannot unset offset of type array on ArrayObject

0 commit comments

Comments
 (0)