note 28850 added to function.include
| From: | dnac at NOSPAM dot linuxmail dot org | Date: | Sat, 25 Jan 2003 23:33:19 +0000 |
| Subject: | note 28850 added to function.include | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-42745@lists.php.net to get a copy of this message | ||
This may be obvious but...
It should be noted that only _variables_ in the included file inherit the variable scope of the
location that the include is made. This means that if there is a function or class in the include
file and the file is included by a function or method, the function and class are global. If a file
is included into a method and that file has a global variable, then that variable will only be
available to that method -- not the whole class.
Again, sorry if this is obvious but it rules out some possibilities such as adding methods to
classes via include files.
Cheers,
dnac
--
http://www.php.net/manual/en/function.include.php
http://master.php.net/manage/user-notes.php?action=edit+28850
http://master.php.net/manage/user-notes.php?action=delete+28850
http://master.php.net/manage/user-notes.php?action=reject+28850