|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27569 include/require does not work within class definition
Submitted: 2004-03-11 10:23 UTC Modified: 2004-03-11 10:34 UTC
From: jochen at kokemuller dot de Assigned:
Status: Not a bug Package: Output Control
PHP Version: 5.0.0b4 (beta4) OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
17 - 1 = ?
Subscribe to this entry?

 [2004-03-11 10:23 UTC] jochen at kokemuller dot de
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:
//This is file foo.php

class foo
// whatever bar.php
// neither works with include


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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-03-11 10:34 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

This is not supposed to work.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 08:01:30 2024 UTC