|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #29416 ob_include function
Submitted: 2004-07-28 01:30 UTC Modified: 2013-08-06 17:41 UTC
Avg. Score:3.0 ± 2.0
Reproduced:0 of 2 (0.0%)
From: edwin at cheatah dot nl Assigned:
Status: Wont fix Package: *General Issues
PHP Version: Irrelevant OS:
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: edwin at cheatah dot nl
New email:
PHP Version: OS:


 [2004-07-28 01:30 UTC] edwin at cheatah dot nl
I often use something like the following code:

ob_start ();
include './tpl/mail.php';
$message = ob_get_contents ();
ob_end_flush ();

I would very much like to see a function of control stucture like this:
$message = ob_include ( './tpl/mail.php' );
// or
$message = ob_include './tpl/mail.php';

Of course ob_include_once, ob_require and ob_require_once behave similarly.

(Creating a custom function in PHP code is NOT possible, for the function's scope would be used.)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-08-06 08:01 UTC]
-Status: Open +Status: Wont fix -Package: Feature/Change Request +Package: *General Issues
 [2013-08-06 08:01 UTC]
$message = ob_include ( './tpl/mail.php' );

You should use

$message = file_get_contents();

since it is unrelated to "output".
 [2013-08-06 17:41 UTC] edwin at cheatah dot nl
Are you serious? This is what you come up with after 9 years of contemplation?
Actually I haven't been a web developer for over 5 years now, so I don't need the feature anymore. But you should be ashamed of yourself. First of all for leaving open a feature request this long, but even more so for not understanding the problem and for your worthless answer. Nice demonstration of incompetence.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Oct 18 08:03:34 2021 UTC