Solve PHP error: "Deprecated: Assigning the return value of new ..."

Instructions: Battery replacement for the Ion Audio Blockrocker

Icon instructionsToday I moved an old script (a [Social Bookmarking Catalog-> social-bookmarking-directories], based on [Scuttle-> scuttle]) to a new hosting. Unfortunately, some errors occurred after the move. The most common one was a PHP error with the message "Deprecated: Assigning the return value of new ..." and then the file name and line number were specified. I assume this error is due to the newer PHP version running on the new hosting (I booked it with [All-Inkl-> all-inkl-Hosting]).

Fortunately, there is a relatively simple solution for this PHP error, so that you don't have to rebuild the whole script. The correction goes as follows:

In the file mentioned in the PHP warning you will probably find an entry like this one in the corresponding line:

$form =& new stdClass();

It depends less on the variables or the function than on the "&" that is hidden in the programming. This is deleted out, so that the call looks something like this afterwards:

$form = new stdClass();

Then you save the file or reload it on the server and call up the website again. One of the errors and warnings from PHP should now be resolved.


Did you like the article and did the instructions on the blog help you? Then I would be happy if you the blog via a Steady Membership or at Patreon would support.

Leave a Comment

Your e-mail address will not be published.