ID: 11835 Updated by: jan Reported By: [EMAIL PROTECTED] Old-Status: Open Status: Closed Bug Type: Scripting Engine problem Operating system: PHP Version: 4.0.4pl1 Assigned To: Comments: include is not allowed there, use the constructor instead class { function class () { include('2.php'); //same with require } } Previous Comments: --------------------------------------------------------------------------- [2001-07-02 09:14:57] [EMAIL PROTECTED] Require nor Include works inner a class file. This is the file where I define the class: ===== 1.php ===== <? class test { include("2.php"); //the same with require } ?> ===== end ===== And this is the file where I have content. ===== 2.php ===== <? var $a=1; function method1 () { $this->a++; } ?> ===== end ===== This does not work. The error is: ======== Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' ======== --------------------------------------------------------------------------- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=11835&edit=2 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]