Php By Reference

前端 未结 5 909
夕颜
夕颜 2020-12-17 06:03

Can someone please explain what the \"&\" does in the following:

class TEST {

}

$abc =& new TEST();

I know it is by reference. Bu

5条回答
  •  既然无缘
    2020-12-17 06:55

    The PHP Manual does a pretty decent job of explaining references.

    I should note, that they are NOT the same thing as a pointer or a reference in many other languages, although there are similarities. And as for objects being "passed by reference" by default - that's not exactly true either.

    I would recommend reading the manual section first (and probably then re-reading a couple of times until you get it), and then come back here if you still have more questions.

提交回复
热议问题