From: [EMAIL PROTECTED]
Operating system: Windows 2000, Windows XP
PHP version: 4.1.2
PHP Bug Type: Class/Object related
Bug description: Function called from class treats GLOBAL vars in different way...
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 ---
--
Edit bug report at http://bugs.php.net/?id=16614&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=16614&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=16614&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=16614&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=16614&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=16614&r=support
Expected behavior: http://bugs.php.net/fix.php?id=16614&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=16614&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=16614&r=submittedtwice