note 26261 added to ref.classobj
| From: | ernest at vogelsinger dot at | Date: | Thu, 24 Oct 2002 12:18:43 +0000 |
| Subject: | note 26261 added to ref.classobj | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-38500@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/ref.classobj.php
http://master.php.net/manage/user-notes.php?action=edit+26261
http://master.php.net/manage/user-notes.php?action=delete+26261
http://master.php.net/manage/user-notes.php?action=reject+26261