Example of an & amp; application in php :? $ A = 1; $ B = & amp; $ a; $ B = 2; echo $ B; // 2 echo $ a; // 2? 1 indicates that a reference is passed to the function. If you really want to use references to pass. You need functiona (& amp; $ obj) {} to accept it. However, it is not recommended that 2 be used to transfer & Applications in php
Example:
?
$ A = 1; $ B = & $ a; $ B = 2; echo $ B; // 2 echo $ a; // 2
? 1
Indicates that a reference is passed to the function. If you really want to use references to pass. You need function a (& $ obj) {} to accept it. However, 2 is not recommended to indicate that a variable is passed. It is only a reference message for receiving. Not recommended. Description in the manual. Php4.1, it seems that from this version, php introduced the variable count function. There is no additional memory expenditure for variable transfer. In addition, the reference transfer requires another reference count, so it is not recommended to pass the reference. if the variable is not very large, it is recommended to use the pass value instead of reference. Starting from php5. All Obj values are passed by reference. No matter whether & = and & = are used for Obj operations, a warning message is displayed. Therefore, it is usually easier to pass references without passing references.
& Indicates that address transfer saves memory when you need to operate on big data, when multiple function return values are required, you can also reference passing parameters. I found an article on the internet for you to see, which should help you understand.
Reference: http://blog.sina.com.cn/s/blog_4f9fc6e10100av1p.html
A pointer can be a memory address or a value in the memory address. a reference refers to two variables pointing to the same memory, that is, the names are different.
?