warning is comin in a php file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gagan
Forum Newbie
Posts: 10
Joined: Fri Jan 30, 2009 5:03 am

warning is comin in a php file

Post 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
User avatar
sergio-pro
Forum Commoner
Posts: 88
Joined: Sat Dec 27, 2008 12:26 pm

Re: warning is comin in a php file

Post 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) {
...
 
Post Reply