Bug #11572 Updated: global variables cannot be accessed from an objects function?
| From: | hholzgra@php.net | Date: | Wed, 20 Jun 2001 21:34:14 +0000 |
| Subject: | Bug #11572 Updated: global variables cannot be accessed from an objects function? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-57472@lists.php.net to get a copy of this message | ||
ID: 11572
Updated by: hholzgra
Reported By: vincev@gmx.de
Old-Status: Open
Status: Bogus
Bug Type: Scripting Engine problem
Operating system:
PHP Version: 4.0.4pl1
Assigned To:
Comments:
the constructors are called *before* assigning
the results so what do you expect to happen?
Previous Comments:
---------------------------------------------------------------------------
[2001-06-20 01:44:14] vincev@gmx.de
class a {
function a() {
if(!isset($GLOBALS["b"])) {
echo "loading b";
$GLOBALS["b"] = new b();
}
}
}
class b {
function b() {
if(!isset($GLOBALS["a"])) {
echo "loading a";
$GLOBALS["a"] = new a();
}
}
}
# creates an infinite loop
new a();
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11572&edit=2