search

Home  >  Q&A  >  body text

The order of variable assignment

I am a novice, what I want to ask is, if the variable assigned in the third line is assigned again in line 7, the result is the assignment in line 7, and the assignment in the third line above is executed. .

phpcn_u11218phpcn_u112182671 days ago1583

reply all(2)I'll reply

  • nearest

    nearest2017-07-25 20:13:54

    $a = &$b;

    At this time, $a not only assigns the value of $b, but also obtains the location of $b in the memory. Therefore, when $a changes, the variable value here in the memory also changes. , $b also changes.

    reply
    0
  • 怪我咯

    怪我咯2017-07-23 09:47:13

    Reference assignment is used here. Please see this sentence. Declaration $bar = &$fo;Add ampersand before $fo. What is the value of $bar? What is the value of $fo

    reply
    0
  • Cancelreply