Webhosting and cheap domain registration services
  

 Home

PHP Manual
PrevChapter 19. References ExplainedNext

Spotting References

Many syntax constructs in PHP are implemented via referencing mechanisms, so everything told above about reference binding also apply to these constructs. Some constructs, like passing and returning by-reference, are mentioned above. Other constructs that use references are:

global References

When you declare variable as global $var you are in fact creating reference to a global variable. That means, this is the same as:

<?php
$var
=& $GLOBALS["var"];
?>

That means, for example, that unsetting $var won't unset global variable.

$this

In an object method, $this is always reference to the caller object.


PrevHomeNext
Unsetting ReferencesUpSecurity

 

  

 

 

 Network sites:

Domain registration : Domain registration and domain name transfer services
Cheap Domain Registrar : Cheap domains or register domain name from $5.95
 

Disclaimer: This documentation is provided only for the benefits of our hosting customers.
For authoritative source of the documentation, please refer to http://www.php.net/docs.php