Jump to content

eval a "function"?


dough boy

Recommended Posts

Ok...got a really weird one here.

 

Long story short I need to pass in a call to a function.  This call is a call to another class/function.  So here is what I have:

 

class Misc extends ClassA {

function runFunction($func) {
return eval($func);
}

}

class MyClass extends ClassA {

function myFunction($vars) {
return $data;
}

}

$misc->runFunction("MyClass::myFunction('myValue');")

 

Any thoughts?  I run it this way and I get a "Parse Error: syntax error, unexpected $end".  If I take out the eval and just manually put the call there and call $misc->runFunction() it works fine.

 

Help!?!?!??!?!

Link to comment
https://forums.phpfreaks.com/topic/114872-eval-a-function/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.