PHP 4.0 Bug #2193 Updated: Global declared variables not gobal

From: Date: Mon, 30 Aug 1999 15:08:42 +0000
Subject: PHP 4.0 Bug #2193 Updated: Global declared variables not gobal
Groups: php.dev 
Request: Send a blank email to php-dev+get-10352@lists.php.net to get a copy of this message
ID: 2193 Updated by: zeev Reported By: lemming@k332.feld.cvut.cz Status: Closed Bug Type: Scripting Engine problem Assigned To: Comments: Your code is wrong. When you include a file from within a function, the included code is executed in the scope of that function. Thus, when you include t1.php from Test2(), $T=1 is executed in the scope of Test2(), and does not become a global variable. For that reason, global $T inside Test() does not attach to this variable. Full Bug description available at: http://bugs.php.net/version4/?id=2193

« previous php.dev (#10352) next »