What does the continuous use of "equal sign" mean? Below is a piece of code in dedecms: $ dsql = $ db = new & nbsp; DedeSql (FALSE) a "=" number is a value assignment. what does this method mean ?, What is the meaning of "equal sign" for continuous assignment?
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;//a a