diff options
| author | Felipe Pena <felipe@php.net> | 2008-06-15 18:31:10 +0000 |
|---|---|---|
| committer | Felipe Pena <felipe@php.net> | 2008-06-15 18:31:10 +0000 |
| commit | c4bc06b48053ddec0f3169eec5a7275d43e446aa (patch) | |
| tree | 5432efb7018be0dd3773429409350ecac6aca452 | |
| parent | 4c65f7b0a234821738bf93b04e9fa7cf2c5d0e8e (diff) | |
| download | php-git-c4bc06b48053ddec0f3169eec5a7275d43e446aa.tar.gz | |
- MF5.3: Improved warning message to call-time pass-by-reference when used with internal function
(http://news.php.net/php.internals/38252)
| -rw-r--r-- | Zend/zend_compile.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 1bd3a4079a..ea59a92144 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1587,14 +1587,19 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC) zend_stack_top(&CG(function_call_stack), (void **) &function_ptr_ptr); function_ptr = *function_ptr_ptr; - if (original_op==ZEND_SEND_REF - && !CG(allow_call_time_pass_reference)) { - zend_error(E_COMPILE_WARNING, - "Call-time pass-by-reference has been deprecated; " - "If you would like to pass it by reference, modify the declaration of %s(). " - "If you would like to enable call-time pass-by-reference, you can set " - "allow_call_time_pass_reference to true in your INI file", - (function_ptr ? function_ptr->common.function_name : "[runtime function name]")); + if (original_op == ZEND_SEND_REF && !CG(allow_call_time_pass_reference)) { + if (function_ptr && + function_ptr->common.function_name && + function_ptr->common.type == ZEND_USER_FUNCTION && + !ARG_SHOULD_BE_SENT_BY_REF(function_ptr, (zend_uint) offset)) { + zend_error(E_COMPILE_WARNING, + "Call-time pass-by-reference has been deprecated; " + "If you would like to pass it by reference, modify the declaration of %s(). " + "If you would like to enable call-time pass-by-reference, you can set " + "allow_call_time_pass_reference to true in your INI file", function_ptr->common.function_name); + } else { + zend_error(E_COMPILE_WARNING, "Call-time pass-by-reference has been deprecated"); + } } if (function_ptr) { |
