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