| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [2002-04-15 06:26 UTC] daniel at webdevelopers dot cz
  [2002-04-15 19:48 UTC] sniper@php.net
  | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 10:00:02 2025 UTC | 
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; if (is_object($ref)) { $GLOBALS["obj"]=&$ref; # This is the same as '$obj=&$ref;'. Isn't it? #* $obj=&$ref; } } #================================================================================================== $test=new test(); var_dump($obj); ?> </PRE> --- SCRIPT: END ---