Fix – Deprecated: Assigning the return value of new by reference is deprecated in PHP5.3

i recently updated to latest PHP 5 from PHP 4 and my wordpress blog was littered with these errors. I have seen these warnings before with PHP 5. Dont worry! The fix is very easy.

Deprecated: Assigning the return value of new by reference is deprecated in /home/topbest/public_html/wp-settings.php on line 472

Deprecated: Assigning the return value of new by reference is deprecated in /home/topbe/public_html/wp-settings.php on line 487

Deprecated: Assigning the return value of new by reference is deprecated in /home/topbe/public_html/wp-settings.php on line 494

Deprecated: Assigning the return value of new by reference is deprecated in /home/topbe/public_html/wp-settings.php on line 530

Deprecated: Assigning the return value of new by reference is deprecated in /home/topbe/public_html/wp-includes/cache.php on line 103

Deprecated: Assigning the return value of new by reference is deprecated in /home/topbe/public_html/wp-includes/query.php on line 21

Deprecated: Assigning the return value of new by reference is deprecated in /home/topbe/public_html/wp-includes/theme.php on line 623

 

The fix is very easy. The only way you can fix this is update your wordpress to latest version or if you can manually edit the above files on lines,  remove “&”  fix this.

For Example:

$wp_locale = & new WP_Locale();

Remove the & and these warnings will be fixed.