summaryrefslogtreecommitdiff
path: root/Zend/zend_vm_execute.h
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2020-08-16 21:49:20 +0200
committerMáté Kocsis <kocsismate@woohoolabs.com>2020-09-09 10:47:43 +0200
commit9975986b7ef849c3a8e73a48748befbfdc50e416 (patch)
treeb287480ec6e0d4853fa4e1f53d3627836b74d695 /Zend/zend_vm_execute.h
parentc5b42be40e98f1626e2404af069af16cb6510ef3 (diff)
downloadphp-git-9975986b7ef849c3a8e73a48748befbfdc50e416.tar.gz
Improve error messages mentioning parameters instead of arguments
Closes GH-5999
Diffstat (limited to 'Zend/zend_vm_execute.h')
-rw-r--r--Zend/zend_vm_execute.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index af6dd7f090..27f1824050 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -2283,7 +2283,8 @@ static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_ca
USE_OPLINE
SAVE_OPLINE();
- zend_throw_error(NULL, "Cannot pass parameter %d by reference", _arg_num);
+
+ zend_cannot_pass_by_reference(_arg_num);
FREE_OP(opline->op1_type, opline->op1.var);
ZVAL_UNDEF(_arg);
HANDLE_EXCEPTION();
@@ -10564,7 +10565,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CONST_
} else {
count = 1;
}
- zend_error(E_WARNING, "%s(): Parameter must be an array or an object that implements Countable", opline->extended_value ? "sizeof" : "count");
+ zend_error(E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1));
break;
}
@@ -17877,7 +17878,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_TMPVAR_UNUSED_HANDL
} else {
count = 1;
}
- zend_error(E_WARNING, "%s(): Parameter must be an array or an object that implements Countable", opline->extended_value ? "sizeof" : "count");
+ zend_error(E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1));
break;
}
@@ -48242,7 +48243,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CV_UNUSED_HANDLER(Z
} else {
count = 1;
}
- zend_error(E_WARNING, "%s(): Parameter must be an array or an object that implements Countable", opline->extended_value ? "sizeof" : "count");
+ zend_error(E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1));
break;
}