Page 1 of 1

warning is comin in a php file

Posted: Fri Jan 30, 2009 6:07 am
by gagan
HI everyone,

I have got one warning in my php file.Please help me i want to remove this warning .How it can be removed ,warning is :

Warning: Call-time pass-by-reference has been deprecated; 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 in /home/fhlinux146/r/rydergifts.co.uk/user/htdocs/admin/includes/OrderRender.class.php on line 88

gagan

Re: warning is comin in a php file

Posted: Fri Jan 30, 2009 2:36 pm
by sergio-pro
Hi gagan

The warning itself contains information on how it can be removed.
1. You can set an option
allow_call_time_pass_reference=1
in you php.ini file (which is not recommended)
2. Or you should not pass variables to functions by reference.
What it means, is that somewhere in OrderRender.class.php on line 88 there is a function call like that:

Code: Select all

 
$object->doSomth(&$param);
//That should be 
$object->doSomth($param);
 
//AND the '&' sign should be moved to a function declaration:
....
function doSomth(&$param) {
...
//Or you can return from function by reference if you need:
function &doSomth($param) {
...