|  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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: jochen at kokemuller dot de
New email:
PHP Version: OS:


 [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 Feb 27 19:01:28 2024 UTC