PHP error: deprecated: assigning the return value of new by reference is deprecated in

Source: Internet
Author: User
Tags php error

PHP of many friendsProgramAfter the PHP version is upgraded to 5.3, "deprecated: assigning the returnvalue of New by reference is deprecatedin" will appear. This is because after 5.3, the "= &" symbol cannot be used. You can simply use "=.

So there are two solutions to this problem:

1. Downgrade PHP to Version 5.3 or lower, but it is not a wise choice to move back.

2. replace all the "= &" symbols in the program with "=.
 
Http://www.tulongzhiji.com/php-deprecated-assigning-the-return-value-of-new-by-reference-is-deprecated-in/
When I used spreadsheet_excel_reader to import the Excel content to the Database last night, the following prompt was displayed:

Deprecated: assigning the return value of new by reference isdeprecated in

Locate the line with the error:

1$ This-> _ Ole = & New oleread ();

My local environment uses PHP/5.3.3.

The following passage is referenced by thinking

Solution: After php5.3 starts, the "= &" symbol in PHP is abolished. to copy the file, use = to reference it directly. The details are as follows:

1. PhP5 object replication adopts the reference method;
2. If the reference method is not used, add the keyword clone when copying the object;
3. If you want to change some attributes during the replication process, add function _ clone ();

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.