nested include, eval, and function declaration problems
| From: | Jaxon | Date: | Wed, 28 Feb 2001 00:39:57 +0000 |
| Subject: | nested include, eval, and function declaration problems | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-41925@lists.php.net to get a copy of this message | ||
Thought I had this licked but it's giving me a headache ... can anyone help?
here is the index.php:
<?
include_once("functions.inc");
echo functOne();
?>
now functions.inc declares functOne() and functTwo()...
functOne() performs an eval on $string,
and $string contains an "echo functTwo();"
This gets as far as the functTwo call and pukes:
Fatal error:
Call to undefined function:
funOne() in functions.inc: eval()'d code on line 30
If I declare functTwo() within $string, I'm fine, but I want to keep all my
functions in one file :) I cannot include functions.inc again in $string,
because then I'm trying to redeclare functOne() after is has been used...
plus, it's ugly.
ANY pointers appreciated...
cheers!
jaxon