Skip to content

Commit 5753afa

Browse files
committed
Unify error messages
1 parent 966d67b commit 5753afa

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

Zend/zend_vm_def.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6021,7 +6021,7 @@ ZEND_VM_COLD_CONST_HANDLER(110, ZEND_CLONE, CONST|TMPVAR|UNUSED|THIS|CV, ANY)
60216021
HANDLE_EXCEPTION();
60226022
}
60236023
}
6024-
zend_throw_error(NULL, "__clone method called on non-object");
6024+
zend_type_error("clone(): Argument #1 ($object) must be of type object, %s given", zend_zval_value_name(obj));
60256025
FREE_OP1();
60266026
FREE_OP2();
60276027
HANDLE_EXCEPTION();
@@ -6059,7 +6059,7 @@ ZEND_VM_COLD_CONST_HANDLER(110, ZEND_CLONE, CONST|TMPVAR|UNUSED|THIS|CV, ANY)
60596059
if (OP2_TYPE != IS_UNUSED) {
60606060
zval *properties = GET_OP2_ZVAL_PTR(BP_VAR_R);
60616061
if (Z_TYPE_P(properties) != IS_ARRAY) {
6062-
zend_type_error("Updated properties must be of type array, %s given", zend_zval_value_name(properties));
6062+
zend_type_error("clone(): Argument #2 ($withProperties) must be of type array, %s given", zend_zval_value_name(obj));
60636063
FREE_OP1();
60646064
FREE_OP2();
60656065
ZVAL_UNDEF(EX_VAR(opline->result.var));

Zend/zend_vm_execute.h

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)