What does "equal sign" mean for continuation?

Source: Internet
Author: User
What does the continuous use of "equal sign" mean? The following is a piece of code in dedecms: $ dsql $ dbnew & nbsp; DedeSql (FALSE) is assigned a value. what does this method mean? ------ Solution -------------------- assign $ a & nbsp; $ B & continuously use the "equal sign?
The following is a piece of code in dedecms:
$ Dsql = $ db = new DedeSql (FALSE)


A "=" is a value assignment,

What does this method mean?


------ Solution --------------------
Assign values at the same time
$ A = $ B = 1;
Equivalent
$ A = 1;
$ B = 1;

However, note that
$ Dsql = $ db = new DedeSql (FALSE)
Not equivalent
$ Dsql = new DedeSql (FALSE );
$ Db = new DedeSql (FALSE );

The former is that two variables are the same instance.
The latter is an instance for each of the two variables.
------ Solution --------------------
I learned a little more, and the moderator is amazing.
------ Solution --------------------
I have never used it like this.
------ Solution --------------------
This kind of thing requires not memory, but practice.
Class T {
Public $ v = 1;
}

$ A = $ B = new T;
Echo $ a-> v, '', $ B-> v; // 1 1

$ B-> v = 'a ';
Echo $ a-> v, '', $ B-> v; //

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.