Bug #15065 Updated: include behaviour
| From: | tit dot petric at telemach dot net | Date: | Wed, 16 Jan 2002 11:57:08 +0000 |
| Subject: | Bug #15065 Updated: include behaviour | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-77235@lists.php.net to get a copy of this message | ||
ID: 15065
User updated by: tit.petric@telemach.net
Reported By: tit.petric@telemach.net
Status: Open
Bug Type: Feature/Change Request
Operating System: im guessing, all
PHP Version: 4.0.6
New Comment:
it probably applies to all versions of php, atleast 4.x :)
Previous Comments:
------------------------------------------------------------------------
[2002-01-16 06:54:21] tit.petric@telemach.net
If the include() occurs inside a function within the calling file, then
all of the code contained in the called file will behave as though it
had been defined inside that function.
<< this is the current behaviour, straight out of the manual for
include(),..
now, this gets tricky, if you have function includes over 3-4-5 or more
levels of includes, for example
index.php calls subfiles() which includes blah.php which calls
modules.php which includes file.php and so on..
usage of global variables in theese files forces people to use global
definitions like in functions on a global-current-file-scope, or in one
of the lower levels in functions,..
maybe if would be a good idea to make a php.ini switch like
force_global_includes to change this behaviour, so the variables in the
includes always get defined in the global scope?
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=15065&edit=1