note 26262 added to function.include
| From: | ernest at vogelsinger dot at | Date: | Thu, 24 Oct 2002 12:20:57 +0000 |
| Subject: | note 26262 added to function.include | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-38501@lists.php.net to get a copy of this message | ||
It appears as if "include()" and "require()" cannot appear inside a class
definition, but outside a class method.
For example, the construct
class A {
include ('class_a_methods.php');
}
returns an error (unexpected T_INCLUDE), but
class A {
function foo() {
include ('class_a_foo_method.php');
}
}
works as expected.
This is a slight annoyance if one wants to keep class code in manageable chunks.
--
http://www.php.net/manual/en/function.include.php
http://master.php.net/manage/user-notes.php?action=edit+26262
http://master.php.net/manage/user-notes.php?action=delete+26262
http://master.php.net/manage/user-notes.php?action=reject+26262