PHP errorDeprecated: Assigning the return value of new_PHP tutorial

WBOY
Release: 2016-07-13 16:56:57
Original
982 people have browsed it

After upgrading php to php5.3 today, when using =&, the PHP error Deprecated: Assigning the return value of new by reference is deprecated in appears. After searching for some information, I found out that php5.3 does not support =&. .

Deprecated: Assigning the return value of new by reference is deprecated in solution:

Error line: $mysql =& new mysql;

Cause of error: After php5.3 started, the "=&" symbol in php was abolished

Solution:

1. If you want to copy, just use = to quote. The details are as follows: 1. PHP5 object copying uses reference;
2. If you do not use the reference method, you need to add the keyword clone;
when copying the object 3. If you want to change some attributes during the copying process, add the function _clone();

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/631548.htmlTechArticleAfter upgrading php to php5.3 today, I can use =. Deprecated: Assigning the return value of new by reference is deprecated in solution: Error line: $mysql = new mysql...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!