Possible Duplicate:
Assigning the return value of new by reference is deprecated
I’m trying to correct some mistakes that are displayed in my website, but I can not get rid of them.
For the following code:
$string = preg_replace('# +#', ' ', $string);
if($useHtml2text){
$string=new html2text($string);
$string=$string->get_text();
}
return trim($string);
}
I have this mistake
Deprecated: Assigning the return value of new by reference is deprecated in /htdocs/modules/googleshopping/class/myTools.php on line 56
the line concerned is this one
$string=new html2text($string);
I’ve tried almost everything but it is still there.
The errant code isn’t in your script, but in
/htdocs/modules/googleshopping/class/myTools.phpon line 56.A bit of time in Google suggests that this is a Prestashop module of some sort? Take it up with the module author. Tell them to get their act in gear, new-by-ref has been bad practice since PHP 5.0. Considering that the top Google result is also complaining about deprecated errors (about
ereg— ewwwww), I wish you luck. You might want to find an alternate module…In the mean time, if you’re seeing this on a production site, you’ll want to turn off deprecated notices by adjusting
error_reportingwherever most appropriate for your code, either in your init / bootstrap file or in php.ini.