I’m having an issue with the following code. I’m just guessing it’s a scope problem.
public function run() {
return eval('$this->config();');
// This will return null.
return $this->config();
// This will return my config array right.
}
Before anyone asks:
- Not both return are ‘active’ when testing.
- I know eval is evil, but i’m building some kind of terminal for admins to run PHP code.
Do anyone have any suggestions about this terminal thing? (My basic problem is still with the eval…)
evalis returning NULL because that is what it is suppose to do. Right from the documentation page: