#27569 [NEW]: include/require does not work within class definition

From: Date: Thu, 11 Mar 2004 15:23:52 +0000
Subject: #27569 [NEW]: include/require does not work within class definition
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-56315@lists.php.net to get a copy of this message
From: jochen at kokemuller dot de Operating system: Linux PHP version: 5.0.0b4 (beta4) PHP Bug Type: Output Control Bug description: include/require does not work within class definition Description: ------------ require/include does not work within a class definition! I also found bug #11835 with status closed dealing the same topic, but it doesn't seem closed to me! Reproduce code: --------------- <?php //This is file foo.php class foo { // whatever bar.php // neither works with include require("./bar.php"); } ?> Expected result: ---------------- I would expect it to work same way as it does in a function defnition. Actual result: -------------- Parse error: parse error, expecting `T_FUNCTION' in foo.php on line 5 -- Edit bug report at http://bugs.php.net/?id=27569&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27569&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27569&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=27569&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=27569&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=27569&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=27569&r=needscript Try newer version: http://bugs.php.net/fix.php?id=27569&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=27569&r=support Expected behavior: http://bugs.php.net/fix.php?id=27569&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=27569&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=27569&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=27569&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27569&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=27569&r=dst IIS Stability: http://bugs.php.net/fix.php?id=27569&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=27569&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=27569&r=float

« previous php.bugs (#56315) next »