Page 1 of 1

Possible to define methods within eval or include?

Posted: Mon May 19, 2008 5:58 am
by gavagai123
Hi,

Is it possible to define a method of the class from which an 'eval' or 'include' is called within that eval or include? (In php 4.) E.g. I want 'myfunction()' to be a method of 'myclass' in the following:

<?php

class myclass {
function myclass() {
eval("function myfunction() { echo \"TEST\"; }");
}
}

?>

Thanks,

Tom

Re: Possible to define methods within eval or include?

Posted: Mon May 19, 2008 9:24 am
by VladSun
I would advice you not to use eval() ...
What you are trying to achive in general?