Bug #18262: Impossible to use INCLUDE inside CLASS definition
From: bmironov@jonview.com
Operating system: Linux RedHat 6.1
PHP version: 4.1.2
PHP Bug Type: *General Issues
Bug description: Impossible to use INCLUDE inside CLASS definition
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 bug report at http://bugs.php.net/?id=18262&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=18262&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=18262&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=18262&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=18262&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=18262&r=support
Expected behavior: http://bugs.php.net/fix.php?id=18262&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=18262&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=18262&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=18262&r=globals
Thread (4 messages)
- bmironov at jonview dot com