Bug #16611 Updated: Function called from class treats GLOBAL vars in different way...
| From: | sniper@php.net | Date: | Mon, 15 Apr 2002 23:49:23 +0000 |
| Subject: | Bug #16611 Updated: Function called from class treats GLOBAL vars in different way... | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-5067@lists.php.net to get a copy of this message | ||
ID: 16611
Updated by: sniper@php.net
Reported By: daniel@webdevelopers.cz
-Status: Duplicate
+Status: Bogus
Bug Type: Class/Object related
Operating System: Windows 2000, Windows XP
PHP Version: 4.1.2
New Comment:
Please do not submit the same bug more than once.
Previous Comments:
------------------------------------------------------------------------
[2002-04-15 06:27:10] daniel@webdevelopers.cz
Duplicate submission. Sorry.
------------------------------------------------------------------------
[2002-04-15 05:38:35] daniel@webdevelopers.cz
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 ---
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16611&edit=1