cvs: ZendEngine2(PHP_5_2) / zend_compile.c
"Felipe Pena" <[email protected]>
| Newsgroups | gmane.comp.php.cvs.zend |
|---|---|
| Message-ID | <cvsfelipe1213554670@cvsserver> |
felipe Sun Jun 15 18:31:10 2008 UTC
Modified files: (Branch: PHP_5_2)
/ZendEngine2 zend_compile.c
Log:
- MF5.3: Improved warning message to call-time pass-by-reference when used with internal function
(http://news.php.net/php.internals/38252)
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?r1=1.647.2.27.2.48&r2=1.647.2.27.2.49&diff_format=u
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.647.2.27.2.48 ZendEngine2/zend_compile.c:1.647.2.27.2.49
--- ZendEngine2/zend_compile.c:1.647.2.27.2.48 Wed Feb 20 12:04:49 2008
+++ ZendEngine2/zend_compile.c Sun Jun 15 18:31:10 2008
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_compile.c,v 1.647.2.27.2.48 2008/02/20 12:04:49 dmitry Exp $ */
+/* $Id: zend_compile.c,v 1.647.2.27.2.49 2008/06/15 18:31:10 felipe Exp $ */
#include <zend_language_parser.h>
#include "zend.h"
@@ -1587,14 +1587,19 @@
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) {
--
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php