note 20752 rejected from language.references by sander

From: Date: Mon, 15 Apr 2002 16:45:28 +0000
Subject: note 20752 rejected from language.references by sander
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-29378@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 ---

« previous php.notes (#29378) next »