summaryrefslogtreecommitdiff
path: root/Zend/zend_vm_def.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_def.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_def.h')
-rw-r--r--Zend/zend_vm_def.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 9c96328fc4..4e9a2bd467 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -4596,7 +4596,8 @@ ZEND_VM_COLD_HELPER(zend_cannot_pass_by_ref_helper, ANY, ANY, uint32_t _arg_num,
USE_OPLINE
SAVE_OPLINE();
- zend_throw_error(NULL, "Cannot pass parameter %d by reference", _arg_num);
+
+ zend_cannot_pass_by_reference(_arg_num);
FREE_OP1();
ZVAL_UNDEF(_arg);
HANDLE_EXCEPTION();
@@ -8918,7 +8919,7 @@ ZEND_VM_COLD_CONST_HANDLER(190, ZEND_COUNT, CONST|TMPVAR|CV, UNUSED)
} 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;
}