Re: call time pass by reference - help

From: Date: Mon, 15 Jan 2001 08:28:47 +0000
Subject: Re: call time pass by reference - help
Groups: php.general 
Request: Send a blank email to php-general+get-34577@lists.php.net to get a copy of this message
Addressed to: "Matt Friedman" <matt@sprynewmedia.com> php-general@lists.php.net ** Reply to note from "Matt Friedman" <matt@sprynewmedia.com> Sun, 14 Jan 2001 21:21:32 -0800 > > There are a number of methods in the session class of phplib. > > With phplib and php4.0.4 I am seeing the following warnings: Warning: > Call-time pass-by-reference has been deprecated - argument passed by > value; If you would like to pass it by reference, modify the > declaration of [runtime function name](). 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. However, > future versions may not support this any longer. in > /adm/vhosts/theparentreport.com/www/phplib/session.inc on line 273 In the existing code things are passed by reference where the calls are made. The places you see these warnings. This style is going out of style, in favor of one where you define passing by reference in the function definition. What to do: Change the function calls from: function_whatever( &$var1, &$var2 ); to function_whatever( $var1, $var2 ); and change the finction definitions from: function function_whatever( $var1, $var2 ) { to: function function_whatever( &$var1, &$var2 ) { For now, since these are just warnings you could just turn down error reporting, or enable allow_call_time_pass_reference as shown in the warning, but you should seriously consider fixing the problem by changing the code. Someday soon PHP will no longer allow the old syntax at all. For more information see: http://www.php.net/manual/en/html/language.references.html and: http://www.php.net/manual/en/html/features.error-handling.html Rick Widmer Internet Marketing Specialists http://www.developersdesk.com

« previous php.general (#34577) next »