Bug #2136: require/include parsing error
| From: | kamee at methadonia dot net | Date: | Mon, 23 Aug 1999 22:59:20 +0000 |
| Subject: | Bug #2136: require/include parsing error | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-10144@lists.php.net to get a copy of this message | ||
From: kamee@methadonia.net
Operating system: openbsd
PHP version: 3.0.12
PHP Bug Type: Parser error
Bug description: require/include parsing error
i have noticed a problem with the following php code is ran...
<?
class foo {
function foo {
require 'settings.php';
}
}
?>
settings.php
------------
<?
var $foo_variable = 100;
?>
the problem seems that when you include/require a file within a class constructor any variables that
are initialized within the included file are not accessible o
utside of the included php file (ie. i cannot use foo_variable later within the class foo.) I think
this is caused because when the file settings.php is parsed it doesnt consider the variable eligible
for the 'var' addition because of its lack of being within the function declaration (even
though it really is.)