From: tony at marston-home dot demon dot co dot uk
Operating system: WindowsXP
PHP version: 4.3.1
PHP Bug Type: Scripting Engine problem
Bug description: cannot use include statement inside a class
I have a script containing the following:
<?php
include 'person.class.inc';
$CLperson = new Person;
?>
File person.class.inc contains the following:
<?php
require_once 'std.table.class.inc';
class Person extends Default_Table
{
...
}
?>
File std.table.class.inc contains the following:
<?php
class Default Table
{
include 'test.inc';
}
?>
When I run it I get the following error:
"Parse error: parse error, unexpected T_INCLUDE, expecting T_OLD_FUNCTION
or T_FUNCTION or T_VAR or '}' in
F:\Apache2\HTDOCS\XAMPLE\std.table.class.inc on line 4"
The only variation that actually works is:-
$result = include 'test.inc';
BTW, I am using the ISAPI version of PHP under Apache 2.0.44
--
Edit bug report at http://bugs.php.net/?id=22792&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22792&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=22792&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=22792&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22792&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=22792&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=22792&r=support
Expected behavior: http://bugs.php.net/fix.php?id=22792&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=22792&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=22792&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=22792&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22792&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=22792&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=22792&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=22792&r=gnused