php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #45782 New functions require_code/include_code
Submitted: 2008-08-11 05:40 UTC Modified: 2008-08-11 11:20 UTC
From: tristen at netoverdrive dot com dot au Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 5.2.6 OS: all
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tristen at netoverdrive dot com dot au
New email:
PHP Version: OS:

 

 [2008-08-11 05:40 UTC] tristen at netoverdrive dot com dot au
Description:
------------
It would be nice to be able to include code from a variable, ie:

$code = array();

$code[] = "$a = 123";
$code[] = "echo $a";

require_code($code);

Code generation could then work without first having to output the code to a temporary file and then include it.

I know it would be easy enough to write a function to do this but hey: it would make a nice addition to standard PHP.

Reproduce code:
---------------
n/a

Expected result:
----------------
n/a

Actual result:
--------------
n/a

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-11 11:20 UTC] johannes@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

There's eval() but use it with care
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 14:04:04 2025 UTC