Possible Duplicate:
Call-time pass-by-reference has been deprecated;
My Kohana site, get this alert in libraries file.
Call-time pass-by-reference has been deprecated
Thats problem line:
call_user_func('Formo_'.$name.'::load', & $this);
How can i solve this?
Remove the &
before $this
.
PHP5 doesn't need that added - all objects are passed as object identifiers by default, no need to mimic this with passing by reference as it was required for PHP 4.
To pass a variable by reference in php5 you need to have &
on your function declaration. NOT when you are calling the function.
function call_user_func($param1, &$param2) {
// $param2 will be a reference
// as mentioned by damianb though objects are by default references
// http://php.net/manual/en/language.oop5.references.php
}
when calling this just pass in your params as normal and param2 will be passed by reference.
http://php.net/manual/en/language.references.pass.php
The above link clearely explains the error.
Note: There is no reference sign on a function call - only on function definitions. Function definitions alone are enough to correctly pass the argument by reference. As of PHP 5.3.0, you will get a warning saying that "call-time pass-by-reference" is deprecated when you use & in foo(&$a);.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With