cvs: ZendEngine2(PHP_5_3) / zend_compile.c

From: Date: Sun, 15 Jun 2008 18:27:37 +0000
Subject: cvs: ZendEngine2(PHP_5_3) / zend_compile.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-6804@lists.php.net to get a copy of this message
felipe Sun Jun 15 18:27:37 2008 UTC Modified files: (Branch: PHP_5_3) /ZendEngine2 zend_compile.c Log: - 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.41.2.67&r2=1.647.2.27.2.41.2.68&diff_format=u Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.67 ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.68 --- ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.67 Tue Jun 10 23:09:08 2008 +++ ZendEngine2/zend_compile.c Sun Jun 15 18:27:37 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.c,v 1.647.2.27.2.41.2.67 2008/06/10 23:09:08 felipe Exp $ */ +/* $Id: zend_compile.c,v 1.647.2.27.2.41.2.68 2008/06/15 18:27:37 felipe Exp $ */ #include <zend_language_parser.h> #include "zend.h" @@ -2019,14 +2019,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_DEPRECATED, - "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_DEPRECATED, + "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_DEPRECATED, "Call-time pass-by-reference has been deprecated"); + } } if (function_ptr) {

« previous php.zend-engine.cvs (#6804) next »