#18262 [Com]: Impossible to use INCLUDE inside CLASS definition
| From: | velocity at charter dot net | Date: | Sat, 28 Jun 2003 22:16:55 +0000 |
| Subject: | #18262 [Com]: Impossible to use INCLUDE inside CLASS definition | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-42691@lists.php.net to get a copy of this message | ||
ID: 18262
Comment by: velocity at charter dot net
Reported By: bmironov at jonview dot com
Status: Bogus
Bug Type: *General Issues
Operating System: Linux RedHat 6.1
PHP Version: 4.1.2
New Comment:
Technically it may not be a bug... however this functionality greatly
decreases the ability for developers to oganize class methods neatly
and efficiently. How does one go about reporting a "functionality bug?"
Previous Comments:
------------------------------------------------------------------------
[2002-07-10 10:30:16] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
------------------------------------------------------------------------
[2002-07-10 10:30:08] bmironov at jonview dot com
Hello,
We are using PHP in our projects. It would be nice to split some of our
class definitions on several files.
It seems a syntax problem for now (include / include_once / require /
require_once are not allowed inside class definition).
Could you please provide solution for the problem?
Thanks,
Boris
------------------------------------------------------------------------
[2002-07-10 10:26:40] bmironov at jonview dot com
File 1.php
<?php
class Test {
var $text;
function Test ($_text) {
$this->text = $_text;
}
require_once ('2.inc');
}
$a = new Test ("ABC");
$a->output();
?>
File 2.inc
<?php
function output () {
print $this->text;
}
?>
It will produce following error:
Parse error: parse error, unexpected T_REQUIRE_ONCE, expecting
T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in
/usr/local/apache/root/php/test/1.php on line 8
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18262&edit=1