What if assigning the return value of new by reference is deprecated in xxxx & "Warning: Call-time pass-by-reference has been deprecated" appears?

Source: Internet
Author: User

Since php5.3, more and more people have encountered prompts such as "assigning the return value of new by reference is deprecated in XXXX", especially in foreign products (such as WordPress and joolma ), the solution for many people is simple: Switch the PHP version back and the version will be OK. There is no doubt that this is a good way to look at this kind of problem. I think switching back to the old version of PHP is actually a shame for PHP Technology enthusiasts (Improper use of words, which roughly means this ). 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 ();



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.