summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2008-01-10 09:38:23 +0000
committerDmitry Stogov <dmitry@php.net>2008-01-10 09:38:23 +0000
commited8e2fa031ac866193bd37c426ebf896593143ef (patch)
tree7de1cb94ce2d3b77364fcd3ee37e76f40cf78895
parent1300527db5f33516ef5c02a5561580188fe9dd26 (diff)
downloadphp-git-ed8e2fa031ac866193bd37c426ebf896593143ef.tar.gz
Added missing warning message
-rw-r--r--Zend/zend_execute_API.c7
-rw-r--r--ext/reflection/tests/bug42976.phpt8
-rw-r--r--ext/standard/tests/general_functions/bug41970.phpt9
3 files changed, 19 insertions, 5 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index fa7110caa8..d5a323de6a 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -944,6 +944,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
if (ARG_SHOULD_BE_SENT_BY_REF(EX(function_state).function, i + 1)
&& !PZVAL_IS_REF(*fci->params[i])) {
+
if (Z_REFCOUNT_PP(fci->params[i]) > 1) {
zval *new_zval;
@@ -958,8 +959,14 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
zval_ptr_dtor(&method_name);
zval_ptr_dtor(&params_array);
}
+ zend_error(E_WARNING, "Parameter %d to %s%s%s() expected to be a reference, value given",
+ i+1,
+ EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : "",
+ EX(function_state).function->common.scope ? "::" : "",
+ EX(function_state).function->common.function_name);
return FAILURE;
}
+
ALLOC_ZVAL(new_zval);
*new_zval = **fci->params[i];
zval_copy_ctor(new_zval);
diff --git a/ext/reflection/tests/bug42976.phpt b/ext/reflection/tests/bug42976.phpt
index 38aed3a400..3669d957d3 100644
--- a/ext/reflection/tests/bug42976.phpt
+++ b/ext/reflection/tests/bug42976.phpt
@@ -26,9 +26,13 @@ echo "Done\n";
--EXPECTF--
string(9) "x.changed"
-Warning: Invocation of C's constructor failed in %s/bug42976.php on line %d
+Warning: Parameter 1 to C::__construct() expected to be a reference, value given in %sbug42976.php on line 15
+
+Warning: Invocation of C's constructor failed in %sbug42976.php on line 15
string(10) "x.original"
-Warning: Invocation of C's constructor failed in %s/bug42976.php on line %d
+Warning: Parameter 1 to C::__construct() expected to be a reference, value given in %sbug42976.php on line 18
+
+Warning: Invocation of C's constructor failed in %sbug42976.php on line 18
string(10) "x.original"
Done
diff --git a/ext/standard/tests/general_functions/bug41970.phpt b/ext/standard/tests/general_functions/bug41970.phpt
index cc942ffa64..17461a312b 100644
--- a/ext/standard/tests/general_functions/bug41970.phpt
+++ b/ext/standard/tests/general_functions/bug41970.phpt
@@ -12,13 +12,16 @@ var_dump(call_user_func("strlen", $a));
echo "Done\n";
?>
---EXPECTF--
+--EXPECTF--
+Warning: Parameter 1 to sort() expected to be a reference, value given in %sbug41970.php on line 5
NULL
-Notice: Array to string conversion in %s on line %d
+Notice: Array to string conversion in %sbug41970.php on line 6
int(5)
+
+Warning: Parameter 1 to sort() expected to be a reference, value given in %sbug41970.php on line 7
NULL
-Notice: Array to string conversion in %s on line %d
+Notice: Array to string conversion in %sbug41970.php on line 8
int(5)
Done