php.net |  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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jochen at kokemuller dot de
New email:
PHP Version: OS:

 

 [2004-03-11 10:23 UTC] jochen at kokemuller dot de
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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

This is not supposed to work.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri May 27 11:06:36 2022 UTC