Re: Class and variable scope
| From: | Gerard Samuel | Date: | Mon, 19 May 2003 23:06:08 +0000 |
| Subject: | Re: Class and variable scope | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-148227@lists.php.net to get a copy of this message | ||
David Otton wrote:
Try removing the global statement. Think of the include() as a cut'n'paste into the body of your constructor... after inclusion the bar.php code is in the same function as the variable declaration, so it doesn't need it's scope messed with. (As to why the global statement is behaving as it is... not a clue). I tried commenting out the global statements, and the missing variables finally appeared.Unfortunately, for me, the script in question is the database session handler that comes with ADODB. There are several places where these variables gets "globalled", and is messing things up. So I think I have to code my own session handler, as this one may not cut it... Thanks