Interpretation of PHP-based references-Cancelling and locating references
Cancel reference
When unset is a reference, it only disconnects the binding between the variable name and the variable content. This does not mean that the variable content is destroyed. For example:
Not unset $ B, just $.
It may be helpful to understand this analogy with the Unix unlink call.
Reference and positioning
Many PHP syntax structures are implemented through the reference mechanism, so all the above-mentioned reference binding applies to these structures. Some structures, such as reference transfer and return, have been mentioned above. Other referenced structures include:
Global Reference
When a variable is declared with global $ var, a reference to the global variable is actually created. That is to say, it is the same as doing so:
This means that, for example, unset $ var does not unset global variables.
$ This
In the method of an object, $ this is always a reference to the object that calls it.