Bug #11572: global variables cannot be accessed from an objects function?

From: Date: Wed, 20 Jun 2001 05:44:14 +0000
Subject: Bug #11572: global variables cannot be accessed from an objects function?
Groups: php.dev 
Request: Send a blank email to php-dev+get-57338@lists.php.net to get a copy of this message
From: vincev@gmx.de Operating system: debian linux PHP version: 4.0.4pl1 PHP Bug Type: Variables related Bug description: global variables cannot be accessed from an objects function? 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(); -- Edit Bug report at: http://bugs.php.net/?id=11572&edit=1

« previous php.dev (#57338) next »