note 26261 rejected from ref.classobj by didou
| From: | didou@php.net | Date: | Mon, 01 Mar 2004 11:51:50 +0000 |
| Subject: | note 26261 rejected from ref.classobj by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-66033@lists.php.net to get a copy of this message | ||
Note Submitter: ernest@vogelsinger.at
----
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.