Assigning the return value of new by reference is deprecated in

Source: Internet
Author: User
Tags deprecated

PHP shows deprecated:assigning The return value of the ' new by reference was deprecated in solution

When you imported Excel content to the database with Spreadsheet_excel_reader last night, the following prompts appear:

Deprecated:assigning The return value of new by reference is deprecated in

Navigate to the line that went wrong:

[PHP] View plaincopyprint?

$this->_ole =& New Oleread ();

My local environment is made of php/5.3.3.

Solution: php5.3 started, abolished the "=&" symbol in PHP, so want to copy, directly with = reference can. Details are as follows:

1, PHP5 object replication is the use of the way of reference;

2. If you do not use the reference method, you need to add the keyword clone when copying the object;

3, if in the process of copying, at the same time to change some attributes, then increase the function _clone ();

More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/PHP/

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.