note 20752 added to language.references
| From: | sevcik at webdevelopers dot cz | Date: | Mon, 15 Apr 2002 10:10:20 +0000 |
| Subject: | note 20752 added to language.references | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-29357@lists.php.net to get a copy of this message | ||
There is the line marked with '#*' in the following script. One line up
you will find other line that should make the exactly same action (I
think). Try to comment this line and uncomment line with '#*'. The
output will differ. Why?
--- SCRIPT: START ---
<PRE><?php
class test {
function test() {
extfunc($this);
}
}
#___________________________________________________________
function extfunc(&$ref) {
global $obj;
$GLOBALS["obj"]=&$ref; # This is the same as '$obj=&$ref;'. Isn't
it?
#* $obj=&$ref;
}
#===========================================================
$test=new test();
var_dump($obj);
?></PRE>
--- SCRIPT: END ---
--
http://www.php.net/manual/en/language.references.php
http://master.php.net/manage/user-notes.php?action=edit+20752
http://master.php.net/manage/user-notes.php?action=delete+20752
http://master.php.net/manage/user-notes.php?action=reject+20752